asXML string output, writing to file , xml string to file
We have seen how we can create a SimpleXMLElement object. Now we will translate the XML data to a string by using asXML function. Here is the sample code. We have already used our XML data sample file for this.