PHP won't allow header change :'(

Hello,

I just finished (well, almost finished) the Output mySQL data as XML with PHP tutorial and when I tested it, it did not sucede in doing it’s job. I also have another question but I’ll get to that after this. It gave me an error that looked similar to this:

Warning: Cannot modify header information - headers already sent by (output started at ****\parse_mysql_to_xml.php:1) in ****\parse_mysql_to_xml.php on line **3

**and I thing I have apache or php setup incorrectly because I don’t know any other way to fix that (does that sentence make any sense). Does anybody know how to fix that error.

Ok, now for my second question. I was trying to have the script export the final xml to a seperate file, which has an xml extension (unless of course I could give the php script and xml extension). I think I would use some type of fopen like this:
$f=fopen(“welcome.txt”,“r”);
[left]but I don’t know how to then set the text inside to be what I want.
[/left]

Cheers,
Jeff