Solutions about simplexml Add a namespace to an XML element with SimpleXML and PHP Pretty format the XML contents generated with SimpleXML and PHP