code: private List<Node> asList(NodeList n) {
  		return n.getLength() == 0 ? Collections.<Node> emptyList() : new NodeListWrapper(n);
  	}
docs: http://stackoverflow.com/questions/19589231/can-i-iterate-through-a-nodelist-using-for-each-in-java