Christian,
One option. Suppose we have an xml doc that contains same elements inside like
<a>
<b> ..</b>
<b>.. </b>
...
</a>
We can partition all b'b blocks inside clojure and call clojure functions that will work parallel seamless way. Each clojure function will call xquery through basex' java bridge to process its xml block.
Clojure will collect results of all parallel functions and write into disk or call other xquery functions.
Or Clojure call basex to partition xml file and return back parts. Clojure will then call parallel functions with parts
In this way, whenever we need xml processing, clojure will call basex. All threading will be supported by clojure.
Erol Akarsu