I need to use attributes to sort XML:
<src type="operands">
<lala>Operands1</lala>
<lala>Operands2</lala>
</src>
<src type="cycles">
<lala>Cycle1</lala>
<lala>Cycle1</lala>
</src>
<src type="operands">
<lala>Operands3</lala>
</src>
It could create two divs: first with id="operands" and second with id="cycles", where could be Operands1,2,3 and Cycle1,2.
I would take the different elements from src and put them into an array. Then I would sort the array to get them in the desired order.