in reply to Re^2: XML::Generator bad header?
in thread XML::Generator bad header?

You shouldn't be loading the file directly in the header with the Content-type: header as part of the file.

The Content-type: header goes to STDOUT before any other output from your CGI program. It is followed by one blank line.

After the Content-type: header is printed, your XML file's content can be sent to STDOUT from your CGI.

The Content-type: header is never (or at least should never be) part of your actual XML file, so if you open the file directly in the browser, you should not have that as content.

You can read more about the CGI specification at the NCSA, the W3C, or at the CGI section of CGI 1.1 co-author Ken Coar's web site, including info on issues with 1.1 and a draft for CGI 1.2 which may someday supersede it.