Here you can find the source of stream(NodeList nodes)
public static Stream<Node> stream(NodeList nodes)
//package com.java2s; //License from project: Open Source License import java.util.stream.IntStream; import java.util.stream.Stream; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Stream<Node> stream(NodeList nodes) { return IntStream.range(0, nodes.getLength()).mapToObj(nodes::item); }/* w w w . jav a 2 s .c o m*/ }