Conseguí solucionarlo con este código:
Código HTML:
Ver original<organization>
{
for $iterator in doc('file.xml')/association
return
<group root="{$iterator/association/@root}">
{
for $personIterator in $iterator/group/person
where $personIteratornot(@state) and $personIteratornot(.//person/@state)
return $personIterator
}
</group>
}
</organization>