Here you can find the source of getElementByTagName(Element element, String name)
public static Element getElementByTagName(Element element, String name)
//package com.java2s; // Released under the terms of the CPL Common Public License version 1.0. import org.w3c.dom.*; public class Main { public static Element getElementByTagName(Element element, String name) { NodeList nodes = element.getElementsByTagName(name); if (nodes.getLength() == 0) return null; else// w ww .j av a2s . co m return (Element) nodes.item(0); } }