create and save xml file in laravel code example
Example: laravel import xml to database
$xml = new SimpleXMLElement($destinationPath.$fileName, null, true);
$xml = new DomDocument('1.0', 'utf-8'); // Or the right version and encoding of your xml file
$xml->load($destinationPath.$fileName);