Workers replace in xml

how to replace domain name in sitemap.xml file ?
my xml format =>

replace domain to =>

I have not tried it myself on xml, but the HTMLRewriter API should be able to do this. There is an example to do pretty much exactly what your are asking on this blog post: