(: file: pop_distinct_institutions.xq date: 29-July-2010 author: Gary Lewis purpose: Combines institutions from pop_all_years.xml into an XML where each institution is listed only once. usage: Run from path where program is located. example: zorba -f -q pop_distinct_institutions.xq -o pop_distinct_institutions.xml -z indent=yes :) { for $unitid in distinct-values(fn:doc("pop_all_years.xml")/population/survey/inst/@unitid) order by $unitid ascending return }