final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
dynamicContext.setParameterValue("in", Int64Value.makeIntegerValue(3));
final NodeInfo doc = (NodeInfo)exp1.evaluateSingle(dynamicContext);
// Run the second query
dynamicContext.clearParameters();
dynamicContext.setContextItem(doc);
final Object result = exp2.evaluateSingle(dynamicContext);
System.out.println("3*3 + 5 = " + result);
// The result is actually a java.lang.Double
}