throws TransformerException {
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();
for (int i = 0 ; i < length; i++) {
Node match = matches.item(i);
if ( match instanceof Element){
if (getFragment()){