(: XQuery version of 99 Bottles of Beer on the Wall Based on 3 November 2005 Candidate Recommendation syntax; see http://www.w3.org/TR/2005/CR-xquery-20051103/ Coded by David Sewell, dsewell@virginia.edu - 2005-12-27 This version iterates over fn:reverse(0 to 99) rather than using a recursive function (an equally XQuery-ish approach). :) declare namespace my = "http://www.99-bottles-of-beer.net/xquery"; declare function my:plural($bottles as xs:integer?) as xs:string { if ($bottles eq 1) then "" else "s" }; { for $b in reverse(0 to 99) let $howmanyBegin := if ($b > 0) then string(