DOMDocument->saveXML Dumps the internal XML tree back into a string &reftitle.description; DOMDocument string saveXML DOMNodenode Creates an XML document from the dom representation. This function is usually called after building a new dom document from scratch as in the example below. The node is used to output only the node rather than the entire document. Creating a simple HTML document header createElement("HTML"); $root = $doc->appendChild($root); $head = $doc->createElement("HEAD"); $head = $root->appendChild($head); $title = $doc->createElement("TITLE"); $title = $head->appendChild($title); $text = $doc->createTextNode("This is the title"); $text = $title->appendChild($text); echo "
";
echo htmlentities($doc->saveXML());
echo "
"; ?> ]]>
See also DOMDocument->load(), DOMDocument->loadXML() and DOMDocument->save().