I kept playing with it, and got this to work, but all data is one line (not a major problem, but would rather each line of output have one fleet):
let $doc := .
for $x in $doc//Detail/@fleet
order by $x
Any advice appreciated.
Could also add literals, and print out something like this:
where fleet = 'B-737' or 'B-738'
so I could actually generate a SQL statement?