let $auction := doc("http://monetdb.cwi.nl/xmark/auctions.xml") return
for $i in
distinct-values($auction/site/people/person/profile/interest/@category)
let $p :=
for $t in $auction/site/people/person
where $t/profile/interest/@category = $i
return
{$t/profile/gender/text()}
{$t/profile/age/text()}
{$t/profile/education/text()}
{fn:data($t/profile/@income)}
{$t/name/text()}
{$t/address/street/text()}
{$t/address/city/text()}
{$t/address/country/text()}
{$t/emailaddress/text()}
{$t/homepage/text()}
{$t/creditcard/text()}
return {{$i}, $p}