XML sitemap files are specified at sitemaps.org. The description for
urlset > url > lastmod says
The date of last modification of the file. This date should be in W3C Datetime format. This format allows you to omit the time portion, if desired, and use YYYY-MM-DD.
Note that this tag is separate from the If-Modified-Since (304) header the server can return, and search engines may use the information from both sources differently.
I find this confusing. The term "file" is used exclusively to refer to the XML sitemap.xml (or to files that make up the sitemapindex). Why is this part of the
url tag then? The value can't possibly be different for two urls in the same XML file. Also, "If-Modified-Since" is a request header and would never be returned by an RFC compliant web server.
In contrast, the description for
sitemapindex > sitemap > lastmod is quite clear and makes sense (note the use of the term "file"):
Identifies the time that the corresponding Sitemap file was modified. It does not correspond to the time that any of the pages listed in that Sitemap were changed.
Is this the canonical specification for XML sitemaps? Is there a newer, revised version? Or is there some authoritative clarification, preferably from Google?