Dynamically created sitemap.xml

Enonic version: 6.x

What is best practice to create sitemap.xml in Enonic? I have an sitemap index file, where sitemaps for different categories (eg. news, articles etc) are linked.
How can I dynamically populate the sitemap.xml files? Anyone have experience with this in Enonic?

Create a mapping for /site.xml and build it using the mapped controller.

NB! The mappings definitions have been fixed for 6.7