docs: function xmlResolveEntities(s) {
  
    var parts = stringSplit(s, '&');
  
    var ret = parts[0];
    for (var i = 1; i < parts.length; ++i) {
      var rp = parts[i].indexOf(';');
      if (rp == -1) {
        // no entity reference: just a & but no ;
        ret += parts[i];
        continue;
      }
  
      var entityName = parts[i].substring(0, rp);
      var remainderText = parts[i].substring(rp + 1);
  
      var ch;
      switch (entityName) {
        case 'lt':
          ch = '<';
          break;
        case 'gt':
          ch = '>';
          break;
        case 'amp':
          ch = '&';
          break;
        case 'quot':
          ch = '"';
          break;
        case 'apos':
          ch = '\'';
          break;
        case 'nbsp':
          ch = String.fromCharCode(160);
          break;
        default:
          // Cool trick: let the DOM do the entity decoding. We assign
          // the entity text through non-W3C DOM properties and read it
          // through the W3C DOM. W3C DOM access is specified to resolve
          // entities.
          var span = domCreateElement(window.document, 'span');
          span.innerHTML = '&' + entityName + '; ';
          ch = span.childNodes[0].nodeValue.charAt(0);
      }
      ret += ch + remainderText;
    }
  
    return ret;
  }