This contribution is taken from http://addons.oscommerce.com/info/6583
Thanks to Jack_mcs for providing the upgraded versions.
The problem with Jack_mcs contribution, which was originally authored by Chemo, was that all the links and database actions were hard-coded.
This created a problem if you were trying to use this with FWR Media's Ultimate SEO URL.
FWR Media does provide a Google XML Sitemap SEO however, that version is a bit outdated.
The attached version is based on Jack_mcs's latest version 1.5
Code has been tested to work for v 2.2 and v 2.3 of osCommerce.
Support Thread: http://forums.oscommerce.com/topic/366544-google-xml-sitemap-seo-compatible-with-fwr-media-ultimate-seo-url-5/