SimpleXMLElement->asXML
Return a well-formed XML string based on SimpleXML element
DescriptionstringSimpleXMLElement->asXML
The asXML method formats the parent object's data
in XML version 1.0.
Get XMLtextstuffcode
XML;
$xml = simplexml_load_string($string);
echo $xml->asXML(); // textstuff ...
?>
]]>
asXML also works on Xpath results:
Using asXML() on
Xpath
results
*/
$result = $xml->xpath('/a/b/c');
while(list( , $node) = each($result)) {
echo $node->asXML(); // text and stuff
}
?>
]]>