Here you can find the source of toList(final NodeList aList)
@SuppressWarnings("unchecked") public static final <T> List<T> toList(final NodeList aList)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import org.w3c.dom.NodeList; public class Main { @SuppressWarnings("unchecked") public static final <T> List<T> toList(final NodeList aList) { final List<T> list = new ArrayList<T>(); for (int x = 0; x < aList.getLength(); ++x) { list.add((T) aList.item(x)); }/*from w w w.j a v a 2 s . c o m*/ return list; } }