Use Liquid tempating sitemap. Way simpler and easier.