Here you can find the source of getSubElement(Element ele, String tagName)
public static Element getSubElement(Element ele, String tagName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element getSubElement(Element ele, String tagName) { NodeList list = ele.getElementsByTagName(tagName); if (list.getLength() > 0) { return (Element) list.item(0); } else//from w ww. j a v a 2 s . c om return null; } }