Chenge url with cloudflare workers

I use an old sitemap on my website that uses my old website link. I’m going to redirect the links to this sitemap to my new site address. The current sitemap format is as follows:

Based on the reviews I found that this can be done with the workers feature in cloudflare, I even got resources but I didn’t succeed.
Source address