{
String val = null;
XObject xObject = XPathAPI.eval(d, query);
final int objectType = xObject.getType();
if (objectType == XObject.CLASS_NODESET) {
NodeList matches = xObject.nodelist();
int length = matches.getLength();
vars.put(concat(refName,MATCH_NR), String.valueOf(length));
for (int i = 0 ; i < length; i++) {
Node match = matches.item(i);
if ( match instanceof Element){