We process large XML strings (over 1Gb) and want to remove the root node of them. The following code works with simplexml but blows up the ram usage of our server as it creates a whole object tree of the structure.
$content = '<content with="random" attributes="hello"><file>text which is over 1gb with sub nodes</file><file>another large text</file></content>';
$xml = new SimpleXMLElement($content);
echo $xml->children()->saveXML();
Is there a ram friendly way to remove the root node of a large XML string?