Sort newest to oldest in sitemap files

Closes #4611

Refactored generateXmlFromNodes to pull the urlElements itself from sorted values in the lookup.

Added some checks to existing unit tests to validate ordering.