}
// If we can't determine the primitive type at compile time, we generate a run-time typeswitch
LetExpression let = new LetExpression();
let.setRequiredType(SequenceType.OPTIONAL_ATOMIC);
let.setVariableQName(new StructuredQName("nn", NamespaceConstant.SAXON, "nn" + let.hashCode()));
let.setSequence(operand);
LocalVariableReference var = new LocalVariableReference(let);
Expression isDouble = new InstanceOfExpression(
var, SequenceType.makeSequenceType(BuiltInAtomicType.DOUBLE, StaticProperty.ALLOWS_ZERO_OR_ONE));