public Iterator iterator() {
   // If nodefilters are set, must execute them first to create node-set
   if (xi.getNodeFilters() != null && !xi.getNodeFilters().isEmpty()) {
     return Collections.unmodifiableSet(getNodeSet(xi.getNodeFilters())).iterator();
   }
   try {
     return Collections.unmodifiableSet(xi.getNodeSet()).iterator();
   } catch (Exception e) {
     // should not occur
     throw new RuntimeException("unrecoverable error retrieving nodeset", e);
   }
 }