in reply to broken cgi script

The error message tells all: there is something the parser does not recognise after the end of the XML document. An XML document contains only one root element, after that element is closed you can't have anything except syntactic constructs that don't impact the document tree: whitespaces, comments or processing instructions. Other elements or non-whitespace characters are forbidden. You can use a parser (or just XML::Parser with perl -MXML::Parser -e'XML::Parser->new( ErrorContext => 1)->parsefile( "file.xml")' to check the XML.