Android examples for XML:XML Node List
Get the first Element from Node List
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { /**//from ww w. jav a 2s . com * @param list * @return */ public static Element firstElement(NodeList list) { for (int i = 0; i < list.getLength(); i++) { if (list.item(i) instanceof Element) { return (Element) list.item(i); } } return null; } }