JW on the eXist list solved my problem, by pointing out a slight syntax change that makes util:expand()
work as it should. This is the working code to retrieve tagged hits inside a modified container:
for $e in collection('/db/moses')//tei:entry[ft:query(., $find)] order by ft:score($e) descending return <tei:entry xml:id="{$e/@xml:id}" n="{$e/ancestor::tei:TEI/tei:teiHeader/tei:revisionDesc/@status}"> {util:expand($e)/*} </tei:entry>
It works really well, and all the normal search string tricks (plus and minus, quotes etc.) work perfectly. Stayed late to get it deployed to the server.