in reply to Print out an XML file to browser
The webserver is going to run this CGI script, so foo.xml should be in the default server directory. If it can't be (which is usually the case for maintainability reasons), you'll have to configure its location for the server and adjust the script as well. See your webserver documentation for info. on configuring file aliases, virtual hosts, etc.
Free your mind
In Section Seekers of Perl Wisdom