Leave the desired canonical pages

The sitemap should contain the final addresses of the pages you want to see in search. Check the response status, canonical and indexing rules of each. Remove old redirect addresses, technical parameters, non-existent and closed pages. Make sure the absolute URLs use the correct domain and HTTPS.

Continue with: Page missing from Google: an indexing checklist.

Put meaningful dates

lastmod should reflect a significant change to a specific page. Automatically updating all dates each time the generator is started makes the signal less useful. A change in text, important data, or structure may be grounds for a new date; simple XML re-creation is not. For language versions, dates are determined by their actual update.

Continue with: Website migrations: redirects and post-launch checks.

Check the published XML

After deployment, open the sitemap through the public domain, check the validity of the XML and the absence of an old cached version. Compare the number of URLs with the page directory and check language alternatives. Viewing the sitemap in Search Console confirms its detection and processing, but the status of each page is monitored separately.

Should I add a 301 URL to the sitemap?

Final canonical addresses are usually used for the current map. Old URLs continue to be served with the necessary redirects outside the sitemap.

Documentation and sources