docs: function(json) {
  
      var resArray = [];
  
      var emitArrayOfObjects = function(json, res) {
  
          var printValue = function(v) {
              var result = null;
              if (typeof(v) === "function") {
                  result = "<![CDATA[";
                  result = result + v.toString();
                  result = result + "]]>";
              } else {
                  result = v;
                  if (typeof(v) !== "string") {
                      if (v !== null && typeof(v) !== 'undefined') {
                          result = v.toString();
                      } else {
                          result = "";
                      }
                  }
                  result = result.replace(/[&]/g, "&amp;");
                  result = result.replace(/[<]/g, "&lt;");
                  result = result.replace(/[>]/g, "&gt;");
              }
              return result;
          };
  
          var emitSimple = function(elemName, value, res) {
              res.push(`<${elemName}>`);
              res.push(printValue(value));
              res.push(`</${elemName}>`);
          };
  
          var emitElement = function(elemName, subElemList, res) {
              if (Array.isArray(subElemList)) {
                  subElemList.forEach(function(subElem) {
                      emitElement(elemName, subElem, res);
                  });
              } else if (typeof subElemList === 'object' && subElemList !== null) {
                  var attrs = [];
                  var textValue = "";
                  if (subElemList._attrs) {
                      for (var attrName in subElemList._attrs) {
                          if (subElemList._attrs.hasOwnProperty(attrName)) {
                              attrs.push(`${attrName}='${subElemList._attrs[attrName]}'`);
                          }
                      }
                  }
                  if (subElemList._text) {
                      textValue = subElemList._text;
                  } else if (subElemList._cdata) {
                      textValue = `<![CDATA[${subElemList._cdata}]]>`;
                  } else if (subElemList.text) {
                      textValue = subElemList.text;
                  }
                  var attrString = attrs.length > 0 ? attrs.join(" ") : "";
                  res.push(attrs.length > 0 ? `<${elemName} ${attrString}>` : `<${elemName}>`);
                  emitArrayOfObjects(subElemList, res);
                  res.push(textValue);
                  res.push(`</${elemName}>`);
  
              } else {
                  emitSimple(elemName, subElemList, res);
              }
          };
  
          for (var key in json) {
              if (json.hasOwnProperty(key) && key !== '_attrs' && key !== '_cdata' && key !== '_text' && key !== 'text') {
                  emitElement(key, json[key], res);
              }
          }
      };
  
      emitArrayOfObjects(json, resArray);
      return resArray.join("");
  }