iterator = exp.iterator(dynamicContext);
} finally {
SaxonDataBindingHelper.CURR_EXECUTING_CONFIG = oldConfigValue;
}
ItemList list = new ItemList();
Item item = iterator.next();
while (item != null) {
list.add(item);
item = iterator.next();
}
if (list.size() == 0) {
return null;
} else if (list.size() == 1) {
item = list.iterator().next();
if (item instanceof NodeInfo) {
return item;
} else {
return Value.asValue(item);