Chg: moved the sitemap generation code to its own library