where $country/ethnicgroups = 'German'
order by $country/name[1]
return <country name='element { replace($country/@name }, ' '/>,'') } {}
(: rewritten to :)
for $country in db:text('factbook', 'German')/parent::ethnicgroups/parent::country
order by $country/name[1]
return <country name='element { replace($country/@name , ' ', '') } {}'/>
</syntaxhighlight>