code: public void appendNsName(final StringBuilder sb,
                             final QName nm) {
      String uri = nm.getNamespaceURI();
      String abbr;
  
      if ((defaultNS != null) && uri.equals(defaultNS)) {
        abbr = null;
      } else {
        abbr = keyUri.get(uri);
        if (abbr == null) {
          abbr = uri;
        }
      }
  
      if (abbr != null) {
        sb.append(abbr);
        sb.append(":");
      }
  
      sb.append(nm.getLocalPart());
    }
docs: Append the name with abbreviated namespace.
  
  @param sb for result
  @param nm QName object