public static XmlElement makeXmlElementRespectingNamespace(String name, KvCons namespaceTable) {
    { int colonPosition = Native.string_position(name, ':', 0);
      String nsPart = "";
      String rawName = "";
      String namespaceUri = null;

      if (colonPosition == Stella.NULL_INTEGER) {
        rawName = name;
      }
      else {
        {
          nsPart = Native.string_subsequence(name, 0, colonPosition);
          rawName = Native.string_subsequence(name, colonPosition + 1, Stella.NULL_INTEGER);
        }
      }
      namespaceUri = StringWrapper.unwrapString(((StringWrapper)(namespaceTable.lookup(StringWrapper.wrapString(nsPart)))));
      if ((namespaceUri == null) &&
          (!Stella.stringEqlP(nsPart, ""))) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Undefined Namespace for Element: `" + nsPart + "'");
          throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      return (Stella.makeXmlElementInternal(rawName, nsPart, namespaceUri, name));
    }
  }