let $end := 10
let $term := 'welcome'
let $test := function($node) { $node/text() contains text { $term } }for $ft in (db:get('DB')//*[text$test(.) contains text { $term }])[position() = $start to $end]
return element hit {
ft:mark($ft[text$test(.) contains text { $term }])
}
</syntaxhighlight>