JSFiddle - React, Tailwind, and code Playground

HTML

<p><code>.children</code> count <span id="childrencount"></span></p>
<p><code>.childNodes</code> count <span id="childnodescount"></span></p>

JavaScript

var req = new XMLHttpRequest();
req.onreadystatechange = function() {
  if (req.readyState !== 4) return;
    
  var city = req.responseXML.getElementsByTagName('city')[0];
    
  document.getElementById('childrencount').textContent = city.children && city.children.length;
  document.getElementById('childnodescount').textContent = city.childNodes.length;
}

req.open('GET', 'http://api.openweathermap.org/data/2.5/weather?q=London&mode=xml');
req.send();