The iterator() method of the XQueryEvaluator class returns an iteration of XdmItem objects. If your query selects nodes, then the XdmItem will always be an XdmNode. If you need to drill down from this, XdmNode.getUnderlyingNode() returns a NodeInfo object, and if the result is actually a JDOM node then you can cast the NodeInfo to VirtualNode and call its getUnderlyingNode() method to get to the JDOM level.
I'm considering providing more direct support in s9api for external object models in a future release, but I wanted to take my time and think carefully how best to do it. It will certainly be more type-safe than the JAXP approach. This will be a lot easier once I'm freed from the constraints of supporting JDK 1.4.
Michael Kay

From: [] On Behalf Of Baxter, Frank (LNG-CON)
Sent: 16 September 2008 15:30
Subject: [saxon] Returning JDOM Elements from an XQuery

I've been able to return the XPath results as Elements by doing this:
      XPathExpression expression = thePathEvaluator.createExpression(query);
      return (List<Element>) expression.evaluate(myDocumentWrapper);
I've been unable to figure out how to do something similiar with XQueryExecutable.  How do you return the XQuery results as a list of org.jdom.Element objects?