The SiteMap.xml Handler is a .ashx handler file for generating Sitemap.xml files for your site. This code is intended as a base for developers but should be ready for any site with one minor adjustment (installation step 2). The .cs file clocks in at less than 100 lines of actual code. Full source is included
1. Drop the files sitemap.ashx and sitemap.ashx.cs into the root of your project.
2. Open sitemap.ashx.cs and adjust the BASE_URL constant to your domain ( i.e. http:///www.yoursite.com/)
3. Add "Sitemap: http:///www.yoursite.com/sitemap.ashx" to your robots.txt file
sitemap.ashx.cs also includes an example of how to append custom urls to the sitemap .xml file.