code: private static String getNodeName(Node n) {
          String nodeName = n.getLocalName();
          if (nodeName == null || nodeName.length() == 0) {
              nodeName = n.getNodeName();
          }
          return nodeName;
      }
docs: extracts the local name of a node.