( FOR $b IN document("census.xml")//person , $c IN $b/person | $b/@spouse->/person , $g IN $c/person | $c/@spouse->/person RETURN )