SAXEventBuffer res = (SAXEventBuffer)
process.processContext().get ("result");
SAXHandler sh = new SAXHandler ();
res.emit (sh);
Document resDoc = sh.getDocument();
XPath xpath = new JDOMXPath("/result/inserted/root/element1/@attr1");
String val = xpath.stringValueOf(resDoc);
assertTrue ("Value is: " + val, val.equals ("42"));
xpath = new JDOMXPath("/result/test");
val = xpath.stringValueOf(resDoc);
assertTrue ("Value is: " + val, val.equals ("42"));
xpath = new JDOMXPath("count(/result/test)");
val = xpath.stringValueOf(resDoc);
assertTrue ("Value is: " + val, val.equals ("5"));
pd.removeProcess(process);
} finally {
workflowService().release (pd);
}