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 );

   }
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 );

   }
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 ) ; }
Extracts typed data from defined XML element.

For it, the XML element must define the data of a single value.

The type name can be defined by 'type' attribute or by the
&lt;Type&gt;Typename&lt;/Type&gt; element.

The type value can be defined as string by 'value' attribute or by the
&lt;Value&gt;A value&lt;/Value&gt; element, or by the string value defined
inside the XML element it self. (&lt;XmlElement type="..."&gt;A Value&lt;/XmlElement&gt;)

@param  \SimpleXMLElement $xmlElement The XML element defining the typed value.
@return mixed The typed value, or NULL if no usable data are defined
Extracts typed data from defined XML element .