Here you can find the source of existNode(Node node, String nodeName, String textValue)
static private boolean existNode(Node node, String nodeName, String textValue)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { static private boolean existNode(Node node, String nodeName, String textValue) { NodeList childs = node.getChildNodes(); for (int i = 0; i < childs.getLength(); i++) { if (childs.item(i).getNodeName().equals(nodeName) && childs.item(i).getTextContent().equals(textValue)) { return true; }//from w ww. j a v a 2 s. c o m } return false; } }