public static function XmlToType( \SimpleXMLElement $xmlElement )
   {

      $type = null;
      $value = null;

      if ( false !== ( $type = XmlAttributeHelper::GetAttributeValue( $xmlElement, 'type' ) ) )
      {
         $type = (string) $type;
      }
      else if ( isset( $xmlElement->type ) )
      {
         $type = (string) $xmlElement->type;
      }
      else if ( isset( $xmlElement->Type ) )
      {
         $type = (string) $xmlElement->Type;
      }
      else
      {
         return $value;
      }

      if ( false !== ( $value = XmlAttributeHelper::GetAttributeValue( $xmlElement, 'value' ) ) )
      {
         $value = (string) $value;
      }
      elseif ( isset( $xmlElement->value ) )
      {
         $value = (string) $xmlElement->value;
      }
      elseif ( isset( $xmlElement->Value ) )
      {
         $value = (string) $xmlElement->Value;
      }
      else
      {
         $value = (string) $xmlElement;
      }

      return static::StrToType( $value, $type );

   }