throws TransformerException
{
String val = null;
XObject xObject = XPathAPI.eval(d, query);
if (xObject.getType() == 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){