XQueryModule mod = proc.parse(query, baseUri);
Sequence result = proc.execute(mod);
SAXWriter saxwriter = new SAXWriter(res_sw, SAXWriter.DEFAULT_ENCODING);
saxwriter.setXMLDeclaration(false);
Serializer ser = new SAXSerializer(saxwriter, res_sw);
ser.emit(result);
} catch (Throwable ex) {
final int errors = expectedErrors.getLength();
if(errors == 0) {
final Node expectedOutputs = (Node) xpath.evaluate("./*[local-name()='output-file'][last()]", testCase, XPathConstants.NODE);
assert (expectedOutputs != null);