I know I am doing it an not so efficient way, I am still learning php. Here's what I am doing now.
MySQL backend.
header("Cache-control: private"); //IE 6 Fix
header("Pragma: no-cache");
header("Content-type: text/xml");
header('Content-Disposition: attachment; filename="controls.xml"');
...
$tempxml = $tempxml . "<dat>\r\n";
$tempxml = $tempxml . " <meta>\r\n";
$tempxml = $tempxml . " <description name=\"Controls.dat XML file\"/>\r\n";
$tempxml = $tempxml . " <version name=\"0.01\"/>\r\n";
...
if($nowhite == 1)
{
$tempxml = str_replace("\r\n", "", $tempxml);
$tempxml = str_replace(" ", "", $tempxml);
}
$tempxml = str_replace( '&', '&', $tempxml );
print $tempxml;