code: public Map<String, Namespace> getNamespaceMap() {
          final Map<String, Namespace> ret = new HashMap<String, Namespace>();
          if (namespaceGroup == null) {
              return ret;
          }
  
          final List<Namespace> namespaces = namespaceGroup.getNamespaces();
          if (hasItems(namespaces)) {
              for (final Namespace ns : namespaces)
                  ret.put(ns.getPrefix(), ns);
          }
  
          final String defns = namespaceGroup.getDefaultResourceLocation();
          if (defns != null) {
              Namespace ns = new Namespace(DEFAULT_NAMESPACE_PREFIX, defns);
              ret.put(DEFAULT_NAMESPACE_PREFIX, ns);
          }
  
          return ret;
      }
docs: Returns the document's namespaces as a mapped keyed by namespace
  {@link Namespace#getPrefix() namespace prefix}.
  
  @return Map of namespaces to instances