protected function simpleXmlToArray(SimpleXMLElement $xml) {
		$result = [];
		
		foreach ($xml as $element) {
			$name    = $element->getName();
			$content = get_object_vars($element);
			
			if (isset($content['@attributes'])){
				if (isset($content['@attributes']['value'])) {
					$result[$name] = Std::parseValue($content['@attributes']['value']);
					continue;
				}
				
				unset($content['@attributes']);
			}
			
			if (empty($content)) {
				$result[$name] = Std::parseValue($element);
				continue;
			}
			
			$result[$name] = $this->simpleXmlToArray($element);
		}
		
		return $result;
	}
protected function simpleXmlToArray(SimpleXMLElement $xml) {
		$result = [];
		
		foreach ($xml as $element) {
			$name    = $element->getName();
			$content = get_object_vars($element);
			
			if (isset($content['@attributes'])){
				if (isset($content['@attributes']['value'])) {
					$result[$name] = Std::parseValue($content['@attributes']['value']);
					continue;
				}
				
				unset($content['@attributes']);
			}
			
			if (empty($content)) {
				$result[$name] = Std::parseValue($element);
				continue;
			}
			
			$result[$name] = $this->simpleXmlToArray($element);
		}
		
		return $result;
	}
protected function simpleXmlToArray ( SimpleXMLElement $ xml ) { $ result = [ ] ; foreach ( $ xml as $ element ) { $ name = $ element -> getName ( ) ; $ content = get_object_vars ( $ element ) ; if ( isset ( $ content [ '@attributes' ] ) ) { if ( isset ( $ content [ '@attributes' ] [ 'value' ] ) ) { $ result [ $ name ] = Std :: parseValue ( $ content [ '@attributes' ] [ 'value' ] ) ; continue ; } unset ( $ content [ '@attributes' ] ) ; } if ( empty ( $ content ) ) { $ result [ $ name ] = Std :: parseValue ( $ element ) ; continue ; } $ result [ $ name ] = $ this -> simpleXmlToArray ( $ element ) ; } return $ result ; }
COnvert the SimpleXMLElement instance into an array recursively

@param  SimpleXMLElement $xml
@return array
COnvert the SimpleXMLElement instance into an array recursively