Fix chunking code refactored from Sitemap
Remove unused code to limit number of resource written in resources_as_xml()
Remove unused return value and tidy comments