Create XML file using PHP

SimpleXMLElement class is required to represent an element in XML document using PHP. To represent child of the XML addChild() method need to call. addChild() method can accept one or two parameter both. After adding all the child node of the XML asXML() method need to call which return a well-formed XML string based on SimpleXML element.

Click here from example of create xml using PHP