Got it ! If only I waited a few more minutes but it was eluding me for hours!! This seems to work: collection=${Array.reverse(q(documentNode).add(q(documentNode).parents()).get())} Best wishes Nick :)