Problem/Motivation
We ran into a situation in which we needed to generate a different URL than was created by the Url::fromUri call in XmlSitemapGenerator::generateChunk() on line 315. I noticed that immediately above it is a TODO concerning the creation of a hook, hook_xmlsitemap_base_url_alter, to alter the Url.
The attached patch includes the creation of a hook to modify the Url object before the string is generated.
Remaining tasks
No remaining tasks
API changes
hook_xmlsitemap_link_url_alter is added - checkout the xmlsitemap.api.php file for information.