Thanks Michael,
a short one..
ft:mark(//p[. contains text 'real'])
will not highlight anything if . contains mixed content with multiple text nodes, what is the best approach to highlight the results of a search, given a query and a matching node?
You may want to add the "any word" option to search all specified words as single terms; e.g.:
let $terms := ( 'real' ) return ft:mark(//p[.//text() contains text { $terms } any word])
This may yield unexpected results for phrases, though.
Hope this helps? Christian