docs: XmlNode.QName toNodeQName(Context cx, Object nameValue, boolean attribute) {
          if (nameValue instanceof XMLName) {
              return ((XMLName)nameValue).toQname();
          } else if (nameValue instanceof QName) {
              QName qname = (QName)nameValue;
              return qname.getDelegate();
          } else if (
              nameValue instanceof Boolean
              || nameValue instanceof Number
              || nameValue == Undefined.instance
              || nameValue == null
          ) {
              throw badXMLName(nameValue);
          } else {
              String local = null;
              if (nameValue instanceof String) {
                  local = (String)nameValue;
              } else {
                  local = ScriptRuntime.toString(nameValue);
              }
              return toNodeQName(cx, local, attribute);
          }
      }