<A>Ab</A>
</Sample>
I want to save the output of the above XML DB, to a new XML File and that too in sorted one-
so my XQuery will be
for $x in doc('sample')//A
order by $x
return file:append("C:\sampleSorted.xml", $x)
but when I open the newly created file I didn't get the expected (sorted) output !!