Here you can find the source of getElement(String elementName, Node rootNode)
public static Node getElement(String elementName, Node rootNode)
//package com.java2s; //License from project: Mozilla Public License import org.w3c.dom.Node; public class Main { public static Node getElement(String elementName, Node rootNode) { Node node = rootNode.getFirstChild(); while (node != null) { if (node.getNodeName().equalsIgnoreCase(elementName)) { return node; }// ww w.j a v a 2s.c o m node = node.getNextSibling(); } return null; } }