Android examples for XML:XML Element
find Element by XML Element name
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Element findElement(Element root, String elementName) { return findElement(root, elementName, 0); }//w w w.j av a 2s . co m public static Element findElement(Element root, String elementName, int index) { NodeList nodeList = root.getElementsByTagName(elementName); if (nodeList != null && nodeList.getLength() > index) { return (Element) nodeList.item(index); } return null; } }