for (Iterator it = map.keySet().iterator(); it.hasNext();) {
String name = (String) it.next();
if (name.equals("complexResult")) {
SAXEventBufferImpl myBuffer
= (SAXEventBufferImpl)map.get(name);
SAXHandler sh = new SAXHandler ();
sh.startDocument();
sh.startElement
("", "temporary-root", "temporary-root", new AttributesImpl());
myBuffer.emit(sh, (LexicalHandler)sh);
sh.endElement ("", "temporary-root", "temporary-root");
sh.endDocument();
org.jdom.Element temporaryRoot = sh.getDocument().getRootElement();
XPath xpath = new JDOMXPath("/temporary-root/row[2]");
org.jdom.Element painter
= (org.jdom.Element)xpath.selectSingleNode(temporaryRoot);
String value = painter.getAttribute("title").getValue();
// check testXSLT.xml for the expected result