public static Iterable<Node> toIterable(NodeList nodeList){
  List<Node> nodes=new ArrayList<>(nodeList.getLength());
  for (int i=0; i < nodeList.getLength(); i++) {
    nodes.add(nodeList.item(i));
  }
  return nodes;
}

public static Iterable < Node > toIterable ( NodeList nodeList ) { List < Node > nodes = new ArrayList < > ( nodeList . getLength ( ) ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { nodes . add ( nodeList . item ( i ) ) ; } return nodes ; }
converts a nodelist to an iterable of nodes .
