PHP XML Header

Output xml from a php file

header ("Content-Type:text/xml");

This should come before any output from the server otherwise the browser will throw an error:

Warning: Cannot modify header information - headers already sent by (output started at /.......) in /....... on line ...