<commands>
<set option='ftindex'>true</set>
<create-db name='factbook'>
https://files.basex.org/xml/factbook.xml</create-db>
<xquery><![CDATA[
let $groups := ('ethnicgroups', 'languages')
let $database := 'factbook'
let $query := 'German'
let $search := ft:search($database, $query)/parent::*
[name() = $groups]/ancestor::country
let $marked := ft:mark(
$search[.//*[name() = $groups][text() contains text { $query }]]
)
return $marked//*[text() = 'German']
]]></xquery>
</commands>