code: private boolean nodeHasAttribute(Node node, String attributeName) {
          return node.hasAttributes() && node.getAttributes().getNamedItem(attributeName) != null;
      }
docs: Check node attribute.
  
  @param node          XML-node
  @param attributeName name of attribute
  @return true if node has attribute with specified name
  false if has not