code: public void addNamespace(String prefix, String namespaceURI) {
          if (prefix == null || namespaceURI == null) {
              throw new IllegalArgumentException("null arguments not allowed.");
          }
          if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
              throw new IllegalArgumentException("Adding a new namespace for " +
                  XMLConstants.XML_NS_URI + "not allowed.");
          } else if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
              throw new IllegalArgumentException("Adding a new namespace for " +
                  XMLConstants.XMLNS_ATTRIBUTE_NS_URI + "not allowed.");
          }
          prefix2ns.put(prefix, namespaceURI);
      }
docs: Add a prefix to namespace mapping.
  
  @param prefix
  @param namespaceURI
  @throws IllegalArgumentException if namespaceURI is one of
  {@value XMLConstants#XML_NS_URI} or {@value XMLConstants#XMLNS_ATTRIBUTE_NS_URI}