You can refer https://www.sitemaps.org/protocol.html#submit_engine
All you need is an URL, then announce that URL as your sitemap.
There is no .xml requirement in the protocol itself.
It’s common to place it at the root as http://example.com/sitemap.xml, but read the reference documentation for all details, you’re not required to, there can be a good reason to not do so and the location of the sitemap file has implications about its contents.
Sitemap.gz & Sitemap.php with internal XML structure is also accepted by google search console.