private static Sequence sorted(Sequence src, List<OrderSpec> orderSpecs, Sequence contextSeq, DynamicContext dynEnv) {
assert (!orderSpecs.isEmpty());
if(src instanceof ISorted) {
src = ((ISorted) src).getSource(); // TODO REVIEWME
}
return new SortedSequence(src, orderSpecs, contextSeq, dynEnv);
}