arg = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_ONE, arg, new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature)); if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC)) arg = new Atomize(context, arg);
	public void setArguments(List arguments) throws XPathException {        Expression arg = (Expression) arguments.get(0);        arg = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_ONE, arg,                new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));            if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))            arg = new Atomize(context, arg);        steps.add(arg);                arg = (Expression) arguments.get(1);        arg = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, arg,                new Error(Error.FUNC_PARAM_CARDINALITY, "2", mySignature));         if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))            arg = new Atomize(context, arg);        steps.add(arg);                if (arguments.size() == 3) {            arg = (Expression) arguments.get(2);            arg = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, arg,                    new Error(Error.FUNC_PARAM_CARDINALITY, "3", mySignature));             if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))                arg = new Atomize(context, arg);            steps.add(arg);                    }	}