docs: final XML newXMLFromJs(Object inputObject) {
          String frag;
  
          if (inputObject == null || inputObject == Undefined.instance) {
              frag = "";
          } else if (inputObject instanceof XMLObjectImpl) {
              // todo: faster way for XMLObjects?
              frag = ((XMLObjectImpl) inputObject).toXMLString();
          } else {
              frag = ScriptRuntime.toString(inputObject);
          }
  
          if (frag.trim().startsWith("<>")) {
              throw ScriptRuntime.typeError("Invalid use of XML object anonymous tags <></>.");
          }
  
          if (frag.indexOf("<") == -1) {
              //    Solo text node
              return newXML(XmlNode.createText(options, frag));
          }
          return parse(frag);
      }