Here you can find the source of getNode(Node node, String nodeName)
public static Node getNode(Node node, String nodeName)
//package com.java2s; //License from project: BSD License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node getNode(Node node, String nodeName) { if (node.getNodeType() == Node.ELEMENT_NODE) { Element el = (Element) node; NodeList nodeList = el.getElementsByTagName(nodeName); if (nodeList.getLength() > 0) { return nodeList.item(0); }/*from w w w . j a v a 2 s.c o m*/ } return null; } }