Output Generated JSON and XML Files from Template

You kinda answered it yourself. Check this: Add custom sitemap - #2 by ju52.

Also, you didn’t tell exactly how you’re using those files, so it could go in the site configuration or some page(s) front matter, but that’s also covered in the documentation.