max = max.max(collator, current);
max = max.max(collator, nextValue);
	public Sequence eval(Sequence contextSequence, Item contextItem)		throws XPathException {		Sequence arg = getArgument(0).eval(contextSequence, contextItem);		if(arg.getLength() == 0)			return Sequence.EMPTY_SEQUENCE;		Collator collator = getCollator(contextSequence, contextItem, 2);		SequenceIterator iter = arg.unorderedIterator();		AtomicValue max = (AtomicValue)iter.nextItem();		if(max.getType() == Type.ATOMIC)			max = max.convertTo(Type.DOUBLE);		AtomicValue current;		while(iter.hasNext()) {			current = (AtomicValue)iter.nextItem();			if(current.getType() == Type.ATOMIC)				current = current.convertTo(Type.DOUBLE);			if(Type.subTypeOf(current.getType(), Type.NUMBER) &&				((NumericValue)current).isNaN())				return DoubleValue.NaN;							max = max.max(collator, current);		}		return max;	}