result = new ContextMappingIterator(this, context2);
// Peek at the first item, and depending on its type, check that all the items
// are atomic values or that all are nodes.
final SourceLocator loc = getSourceLocator();
Item first = result.next();
if (first == null) {
return EmptyIterator.getInstance();
} else if (first instanceof AtomicValue) {
ItemMappingFunction atomicValueChecker = new ItemMappingFunction() {