I want to output raw xml in a manner similar to http://www.google.com/ig/api?weather=Mountain+View but using PHP.
I have a very simple php script on my webserver:
$output = "<root><name>sample_name</name></root>";
By default PHP sets the Content-Type to text/html, so the browsers are displaying your XML document as an HTML page.
For the browser to treat the document as XML you have to set the content-type:
Do this before printing anything in your script.