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

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