setContextDocSet(contextDocs);  Item current; Sequence values; for (Iterator iter = steps.iterator(); iter.hasNext();) {
setContextDocSet(contextDocs);  for (Iterator iter = steps.iterator(); iter.hasNext();) {
    public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {        if (context.getProfiler().isEnabled()) {            context.getProfiler().start(this);                   context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));            if (contextSequence != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);            if (contextItem != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());        }                Sequence result = Sequence.EMPTY_SEQUENCE;                if (steps.size() > 0) {             if (contextSequence != null)                result = contextSequence;                        DocumentSet contextDocs = null;            Expression expr = (Expression) steps.get(0);            if (expr instanceof VariableReference) {                Variable var = ((VariableReference) expr).getVariable();                if (var != null)                     contextDocs = var.getContextDocs();                        }                if (contextDocs != null)            	setContextDocSet(contextDocs);                        Item current;            Sequence values;            for (Iterator iter = steps.iterator(); iter.hasNext();) {                expr = (Expression) iter.next();                if (contextDocs != null)                     expr.setContextDocSet(contextDocs);                if (Dependency.dependsOn(expr.getDependencies(), Dependency.CONTEXT_ITEM)) {                    if (result.getLength() == 0) {                        result = expr.eval(null, null);                    //TODO : strange design : should rather use : else if (result.getLength() == 1) ? -pb                    } else {                                                values = null;                                                if (result.getLength() > 1) values = new ValueSequence();                        int p = 0;                        for (SequenceIterator iterInner = result.iterate(); iterInner.hasNext(); p++) {                            context.setContextPosition(p);                            current = iterInner.nextItem();                            if (values == null)                                values = expr.eval(result, current);                            else                                values.addAll(expr.eval(result, current));                                                   }                        result = values;                    }                } else {                    result = expr.eval(result);                }                if(steps.size() > 1)                    // remove duplicate nodes if this is a path                     // expression with more than one step                    result.removeDuplicates();            }        }                if (context.getProfiler().isEnabled())             context.getProfiler().end(this, "", result);                return result;    }