Android examples for XML:XML Node List
Convert Element List to Node list
//package com.java2s; import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { /**//w ww. j a va2 s . c o m * @param list * @return */ public static List<Element> filterElements(NodeList list) { List output = new ArrayList<Element>(); for (int i = 0; i < list.getLength(); i++) { if (list.item(i) instanceof Element) { output.add(list.item(i)); } } return output; } }