public static function convertFromDOMDocument($root_element, DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $root = new XMLElement($root_element);

        foreach ($xpath->query('.') as $node) {
            self::convertNode($root, $node);
        }

        return $root;
    }
public static function convertFromDOMDocument($root_element, DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $root = new XMLElement($root_element);

        foreach ($xpath->query('.') as $node) {
            self::convertNode($root, $node);
        }

        return $root;
    }
public static function convertFromDOMDocument ( $ root_element , DOMDocument $ doc ) { $ xpath = new DOMXPath ( $ doc ) ; $ root = new XMLElement ( $ root_element ) ; foreach ( $ xpath -> query ( '.' ) as $ node ) { self :: convertNode ( $ root , $ node ) ; } return $ root ; }
Given a `DOMDocument`, this function will convert it to an `XMLElement`
object and return the result.

@since Symphony 2.4
@param string $root_element
@param DOMDOcument $doc
@return XMLElement
Given a DOMDocument this function will convert it to an XMLElement object and return the result .