for (QName variable : exp.getAllUnboundExternalVariables()) {
QName typeQName = variableTypes.get(variable);
Object value = variableResolver.resolveVariable(variable);
if (typeQName != null) {
if (value.getClass().getName().startsWith("java.lang")) {
exp.bindAtomicValue(variable, value.toString(),
xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYATOMICTYPE));
} else if (value instanceof Node) {
exp.bindNode(variable, (Node) value, xqconn.createNodeType());
} else if (value instanceof NodeList) {
NodeList nodeList = (NodeList) value;