// Loading an XML document from a file $xml = new DomDocument(); $xml->load('file.xml');
// Loading an XML document from a string $xmlData = 'In this example, the loadXML() function is used to load an XML document from a string and store it in the $xml variable. The package library used for the DomDocument load() function is part of the PHP core library, so no additional package or library is required.'; $xml = new DomDocument(); $xml->loadXML($xmlData); Some data here