Here you can find the source of toNodeArray(NodeList list)
public static Node[] toNodeArray(NodeList list)
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node[] toNodeArray(NodeList list) { int length = list.getLength(); if (length > 0) { Node[] array = new Node[length]; for (int i = 0; i < length; i++) { array[i] = list.item(i); }//w ww.j a v a 2s .c o m return array; } return null; } }