I have a xml file like this:
<employees>
<emp_num>
<department>1</department>
<salary>1000</salary>
</emp_mum>
<emp_num>
<department>1</department>
<salary>2000</salary>
</emp_mum>
</employees>
I want to know the number of employees per department ordered by the average salary of the department.
My main problem to do this is that "department" and "salary" are at the same level and I don't know how to use FLWOR in this situation.
Try