There's no need to make every .xml file run through the PHP parser; why not just rename the XML file to have a .php extension?
Yet another alternative would be to use mod_rewrite (assuming Apache is your web server daemon) and redirect the .xml request to a .php script.