hey qdox, what's occurring/breaking when it runs?
something easier (imho) that would support any SEO mod, would be to put all of the XML stuff in a TPL file. I've actually written a google sitemap before, based on my XCSEO Sitemap for customers. I pretty much just stripped out anything that wasn't needed, added in the Google XML stuff, and then modified .htaccess to make the php file appear as an XML file
by using smarty (the TPL file), that means most SEO mods would rewrite the links on their own, so you wouldn't have to hardcode anything
cheers