Here you can find the source of getElement(Element parentElement, String nodeName)
public static Element getElement(Element parentElement, String nodeName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getElement(Element parentElement, String nodeName) { NodeList list = parentElement.getElementsByTagName(nodeName); if (list == null || list.getLength() == 0) { return null; }//from ww w .ja v a2s . c o m return (Element) list.item(0); } }