code: public static void processNSDecls(
          SerializationHandler handler,
          int src,
          int type,
          DTM dtm)
          throws TransformerException
      {
  
          try
          {
              if (type == DTM.ELEMENT_NODE)
              {
                  for (int namespace = dtm.getFirstNamespaceNode(src, true);
                      DTM.NULL != namespace;
                      namespace = dtm.getNextNamespaceNode(src, namespace, true))
                  {
  
                      // String prefix = dtm.getPrefix(namespace);
                      String prefix = dtm.getNodeNameX(namespace);
                      String desturi = handler.getNamespaceURIFromPrefix(prefix);
                      //            String desturi = getURI(prefix);
                      String srcURI = dtm.getNodeValue(namespace);
  
                      if (!srcURI.equalsIgnoreCase(desturi))
                      {
                          handler.startPrefixMapping(prefix, srcURI, false);
                      }
                  }
              }
              else if (type == DTM.NAMESPACE_NODE)
              {
                  String prefix = dtm.getNodeNameX(src);
                  // Brian M. - some changes here to get desturi
                  String desturi = handler.getNamespaceURIFromPrefix(prefix);
                  String srcURI = dtm.getNodeValue(src);
  
                  if (!srcURI.equalsIgnoreCase(desturi))
                  {
                      handler.startPrefixMapping(prefix, srcURI, false);
                  }
              }
          }
          catch (org.xml.sax.SAXException se)
          {
              throw new TransformerException(se);
          }
      }
docs: Copy <KBD>xmlns:</KBD> attributes in if not already in scope.
  
  As a quick hack to support ClonerToResultTree, this can also be used
  to copy an individual namespace node.
  
  @param src Source Node
  NEEDSDOC @param type
  NEEDSDOC @param dtm
  
  @throws TransformerException