Load XML from a string and create a Document in PHP
Description
The following code shows how to load XML from a string and create a Document.
Example
/*from www. j a v a2s . co m*/
<?php
$doc = new DOMDocument();
$doc->loadXML('<root><node/></root>');
echo $doc->saveXML();
?>
The code above generates the following result.