src/MediaServices/Internal/ContentPropertiesSerializer.php
private static function _unserializeRecursive(SimpleXMLElement $xml)
    {
        $result = [];
        $dataNamespace = Resources::DS_XML_NAMESPACE;
        /** @var SimpleXMLElement $child */
        foreach ($xml->children($dataNamespace) as $child) {
            if (count($child->children($dataNamespace)) > 0) {
                $value = [];
                $children = $child->children($dataNamespace);
                /** @var SimpleXMLElement $firstChild */
                $firstChild = $children[0];
                if ($firstChild->getName() == 'element') {
                    foreach ($children as $subChild) {
                        $value[] = self::_unserializeRecursive(
                            $subChild
                        );
                    }
                } else {
                    $value = self::_unserializeRecursive(
                        $child
                    );
                }
            } else {
                $value = (string) $child;
            }

            $result[$child->getName()] = $value;
        }

        return $result;
    }
private static function _unserializeRecursive(SimpleXMLElement $xml)
    {
        $result = [];
        $dataNamespace = Resources::DS_XML_NAMESPACE;
        /** @var SimpleXMLElement $child */
        foreach ($xml->children($dataNamespace) as $child) {
            if (count($child->children($dataNamespace)) > 0) {
                $value = [];
                $children = $child->children($dataNamespace);
                /** @var SimpleXMLElement $firstChild */
                $firstChild = $children[0];
                if ($firstChild->getName() == 'element') {
                    foreach ($children as $subChild) {
                        $value[] = self::_unserializeRecursive(
                            $subChild
                        );
                    }
                } else {
                    $value = self::_unserializeRecursive(
                        $child
                    );
                }
            } else {
                $value = (string) $child;
            }

            $result[$child->getName()] = $value;
        }

        return $result;
    }
private static function _unserializeRecursive ( SimpleXMLElement $ xml ) { $ result = [ ] ; $ dataNamespace = Resources :: DS_XML_NAMESPACE ; /** @var SimpleXMLElement $child */ foreach ( $ xml -> children ( $ dataNamespace ) as $ child ) { if ( count ( $ child -> children ( $ dataNamespace ) ) > 0 ) { $ value = [ ] ; $ children = $ child -> children ( $ dataNamespace ) ; /** @var SimpleXMLElement $firstChild */ $ firstChild = $ children [ 0 ] ; if ( $ firstChild -> getName ( ) == 'element' ) { foreach ( $ children as $ subChild ) { $ value [ ] = self :: _unserializeRecursive ( $ subChild ) ; } } else { $ value = self :: _unserializeRecursive ( $ child ) ; } } else { $ value = ( string ) $ child ; } $ result [ $ child -> getName ( ) ] = $ value ; } return $ result ; }
Parse properties recursively.

@param SimpleXMLElement $xml XML object to parse

@return array
Parse properties recursively .