Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { private static Node actualFindNode(Node node, String name) { String nodeName = node.getNodeName(); nodeName = nodeName.substring((nodeName.indexOf(":") != -1 ? nodeName.indexOf(":") + 1 : 0)); if (nodeName.equals(name)) { return node; } if (node.hasChildNodes()) { NodeList list = node.getChildNodes(); int size = list.getLength(); for (int i = 0; i < size; i++) { Node found = actualFindNode(list.item(i), name); if (found != null) return found; } } return null; } }