What a sitemap does, and what it does not
A sitemap is a list of the URLs you consider canonical, offered to crawlers as a suggestion. It speeds up discovery — new pages get found without waiting for a link to be followed — and it gives Search Console an inventory to report indexing against. That inventory is quietly its most useful property: 'sitemap says 180 pages, index has 40' is one of the most diagnostic sentences in technical SEO.
What it does not do is guarantee anything. Listing a URL does not make Google index it, and a page's absence from the sitemap does not stop it being found through links. Crawlers treat the file as a hint, and Google's documentation is explicit that inclusion is a suggestion rather than a command.
It also does not override the page itself. A sitemap entry for a URL that is noindexed, canonicalised elsewhere, or blocked in robots.txt is a contradiction, and search engines resolve contradictions by trusting the page. Keeping the sitemap in agreement with the pages is the actual maintenance task.
The faults that actually matter
The serious ones make parsers stop reading. An unescaped ampersand in a query string is the classic: XML requires &, a strict parser hits the raw & and discards everything after it, and half the file silently vanishes from the crawler's view. The same applies to a truncated file or a <url> block that never closes.
Next are entries that get individually discarded: relative paths where the protocol requires absolute URLs, whitespace inside <loc> from a pretty-printing template, and URLs on a different host from the sitemap — which by default a crawler will not trust the file for.
Then there is the fault that is not in the file at all: a sitemap URL that returns the site's 404 page with a 200 status. Every crawler fetches HTML where it expected XML. This tool quotes the first bytes of what actually came back, which is usually <!DOCTYPE html>, and that one line of evidence settles what went wrong.
lastmod, changefreq and priority — what is worth your time
Of the three optional fields, only lastmod earns attention, and only if it is true. Google has said it uses lastmod when it proves consistently accurate, and learns to ignore it on sites where it is not. A generator that stamps every entry with the build time is therefore worse than one that omits the field — it is teaching Google to distrust the only hint that counts.
changefreq and priority are part of the protocol and validated here, and Google has stated plainly that it ignores both. They are not errors to fix or levers to pull. If a tool or an agency proposes tuning priorities across your sitemap, that is time billed against a field nobody reads.
The limits, for reference: 50,000 URLs and 50MB uncompressed per file. Past either, split the file and list the parts in a sitemap index — which is what most platforms already emit, and why your sitemap.xml is often an index whose children hold the actual pages.