fetch("http://example.com/sitemap.xml").then(d => d.text()).then(d => {
var domParser = new DOMParser();
var doc = domParser.parseFromString(d, 'text/xml');
var urlCount = doc.querySelectorAll('url').length;
console.log("URL Count:", urlCount)
});