code: public static boolean isDefinedNSDecl(
          SerializationHandler serializer,
          int attr,
          DTM dtm)
      {
  
          if (DTM.NAMESPACE_NODE == dtm.getNodeType(attr))
          {
  
              // String prefix = dtm.getPrefix(attr);
              String prefix = dtm.getNodeNameX(attr);
              String uri = serializer.getNamespaceURIFromPrefix(prefix);
              //      String uri = getURI(prefix);
  
              if ((null != uri) && uri.equals(dtm.getStringValue(attr)))
                  return true;
          }
  
          return false;
      }
docs: Returns whether a namespace is defined
  
  
  @param attr Namespace attribute node
  @param dtm The DTM that owns attr.
  
  @return True if the namespace is already defined in
  list of namespaces