result = new ValueSequence(); for (int i = seq.getLength()-1; i>=0; i--) { result.add(seq.itemAt(i)); }
Sequence tmp = new ValueSequence(); Item item; for(SequenceIterator i = seq.iterate(); i.hasNext(); ) { item = i.nextItem(); tmp.add(item); } result = new ValueSequence(); for (int i = seq.getLength()-1; i>=0; i--) { result.add(tmp.itemAt(i)); }
	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 seq = getArguments(contextSequence, contextItem)[0];		if (seq.getLength() == 0)             result = Sequence.EMPTY_SEQUENCE;        else {		  result = new ValueSequence();    		for (int i = seq.getLength()-1; i>=0; i--) {    			result.add(seq.itemAt(i));    		}        }        if (context.getProfiler().isEnabled())             context.getProfiler().end(this, "", result);                 return result;          	}