public SequenceIterator iterate(XPathContext context) throws XPathException {
SequenceIterator seq = argument[0].iterate(context);
AtomicValue startVal0 = (AtomicValue)argument[1].evaluateItem(context);
NumericValue startVal = (NumericValue)startVal0.getPrimitiveValue();
int start = (int)startVal.round().longValue();
if (argument.length==3) {
AtomicValue lengthVal0 = (AtomicValue)argument[2].evaluateItem(context);
NumericValue lengthVal = (NumericValue)lengthVal0.getPrimitiveValue();
int end = start + (int)lengthVal.round().longValue() - 1;