code: public static String getNodesPathName(Node node) {
          final StringBuffer buffer = new StringBuffer();
  
          if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
              buildNodeName(((Attr) node).getOwnerElement(), buffer);
              buffer.append(".");
              buffer.append(node.getLocalName());
          } else {
              buildNodeName(node, buffer);
          }
  
          return buffer.toString();
      }
docs: Returns the path expression for a given node.
  Path expressions look like: Foo.Bar.Poo where elements are
  separated with a dot character.
  
  @param node in DOM tree.
  @return the path expression representing the node in DOM tree.