Is there any function that makes string from PHP SimpleXMLElement
?
You can use the SimpleXMLElement::asXML()
method to accomplish this:
$string = "<element><child>Hello World</child></element>";
$xml = new SimpleXMLElement($string);
// The entire XML tree as a string:
// "<element><child>Hello World</child></element>"
$xml->asXML();
// Just the child node as a string:
// "<child>Hello World</child>"
$xml->child->asXML();