throws XPathException {
final Sequence arg0 = getArgument(0).eval(contextSequence, contextItem);
if(arg0.getCardinality() != Cardinality.EXACTLY_ONE)
{throw new XPathException(this, "Expected exactly one item for first argument");}
final Item item0 = arg0.itemAt(0);
if(item0.getType() != Type.FUNCTION_REFERENCE)
{throw new XPathException(this, "Type error: expected function, got " + Type.getTypeName(item0.getType()));}
final FunctionReference ref = (FunctionReference)item0;
// pass the remaining parameters to the function call