Java tutorial
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { static private Node getNode(Document doc, String nodeName, String textValue) { NodeList nodelist = doc.getElementsByTagName(nodeName); for (int i = 0; i < nodelist.getLength(); i++) { if (nodelist.item(i).getTextContent().equals(textValue)) { return nodelist.item(i); } } return null; } }