I’ve done this in a v8 Project. - It’s not very difficult and probably still works similarly in v9.
As you might know, there is a Default Automated Job that creates the sitemap.xml based on all of your “normal” Concrete CMS Content.
If you want manipulate or add to that, you can use Event Listeners on Events fired by the Core to do that:
Events::addListener('on_sitemap_xml_ready', array($this, 'modifySitemap'));
$xmlDoc = $event->getDocument();
$xmlDoc->addAttribute('xml','Custom XML Attributes as you Desire');