Basically I have several sequences that may be empty, if they are empty then I don't want to output it's parent node. If all of the sequences are empty then I don't want the containing node. Basically I have code similiar to this, which doesn't work:
let $a := //a
let $b := //b
return
<root>
{if (exists($a) or exists($b)) then
<div id="container">
{if (exists($a)) then
<h2>As</h2>
<div>
{for loop for $a sequence...}
</div>
else()
}
{if (exists($b)) then
<h2>Bs</h2>
<div>
{for loop for $b sequence...}
</div>
else()
}
</div>
else()
}
</root>