Here you can find the source of toList(NodeList nodes)
public static List<Node> toList(NodeList nodes)
//package com.java2s; //License from project: BSD License import java.util.ArrayList; import java.util.List; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static List<Node> toList(NodeList nodes) { int len = nodes.getLength(); ArrayList<Node> list = new ArrayList<Node>(len); for (int i = 0; i < len; i++) { list.add(nodes.item(i));//w w w.ja v a 2 s. c o m } return list; } }