// process the query
XPathUtil xu = new XPathUtil(pageContext);
List result =
xu.selectNodes(XPathUtil.getContext(this), select);
Object ret = result;
// unwrap primitive types if that's what we received
if (result.size() == 1) {
Object o = result.get(0);
if (o instanceof String || o instanceof Boolean
|| o instanceof Number)
ret = o;
}
// expose the final result
pageContext.setAttribute(var, ret, scope);
return SKIP_BODY;