Got half way through querying using XQuery.