Issue #2249723 by andrei.dincu: Replace direct db query with api functions in xmlsitemap.generate.inc and in XmlSitemapGeneratorService