Sitecore SXA has a feature for creating sitemap by just following the documentation: configure sitemap. You can use sitemap directly by using this setup or you can include your custom sitemaps to external sitemaps. It is not mentioned in the documentation but you have to include SiteMetadata in site modules…