The following is part of the script i use.
Code: Select all
<?php
header('Content-Type: text/xml');
header("Content-Disposition: filename=$filename");
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
//echo more xml
$filename = 'test.xml';
fopen($filename,'x+');
//$thefile is the xml string
fwrite($filename,$thefile);
fclose($filename);
?>