///DocumentInfo saxonDocInfo = qp.buildDocument(new DocumentWrapper(_parentDecomposition.getInternalDataDocument(), null));
DocumentInfo saxonDocInfo = qp.buildDocument(new StreamSource(
new StringReader(outputter.outputString(element))));
DynamicQueryContext dynamicQueryContext = new DynamicQueryContext();
dynamicQueryContext.setContextNode(saxonDocInfo);
List nodeList = xQueryExpression.evaluate(dynamicQueryContext);
//my code to parse SAXON resulting XML tree and produce a string
//because saxons QueryResult class isn't yet able to produce the desired string from anything
//but the root node
for (int i = 0; i < nodeList.size(); i++) {
NodeInfo nodeInfo = (NodeInfo) nodeList.get(i);