On my webroot, I have a file, say,
foo.php that outputs a valid XML Sitemap. In robots.txt, I have something like:
Will the sitemap be found by Google, etc.?
A .xml extension is not required, it can even be a GET parameter triggering the sitemap.
See http://www.sitemaps.org/: No specification for a particular file extension.