That’s because the sitemap is not a file like an ordinary html page. It is a dynamic feed, created on each request just like your WordPress RSS feed is. Your normal RSS feed can be accessed via yoursi.te/?feed=rss or yoursi.te/feed/ (if you’re using a fancy permalink sturcture) and the sitemap can be found on yoursi.te/?feed=sitemap and yoursi.te/sitemap.xml (if you’re using a fancy permalink sturcture)…
The same goes for your WordPress front page or blog page or even an archive page like yoursi.te/2015/. They are dynamically created upon each request and will include all the latest additions and changes.
Unless (again) you are using a caching plugin. These type of plugins will create either a static html copy of such pages or they create a in-memory copy of database queries to speed things up. Advantage is a huge increase in site speed. Downside may be that for a while (until the cache is considered ‘stale’ and automatically updated) a cached copy is served that does not include all the latest changes.
So i wonder how (a line of code somewhere ? ) a sitemap.xml goes and fetch the new articles updated in the database to be updated..
There is indeed a line (or more) of code somewhere. Not inside a file called sitemap.xml (which does/should not exist) but deep inside the plugin. If you look in the template file /xml-sitemap-feed/includes/feed-sitemap-post_type.php where you’ll find have_posts()
which is a common WordPress function that starts The Loop that fetches posts based on a visitors request.
Hope that clears things up a bit about the ‘innards’ of WordPress and how my plugin fits in there ??
Cheers,
Rolf