I have this .xml example as input:
<root>
<user>
<id>2</id>
<name>xyz</name>
</user>
<user>
<id>1</id>
<name>abc</name>
</user>
</root>
How can I sort the "users" by "id" number to get the following .xml as output:
<root>
<user>
<id>1</id>
<name>abc</name>
</user>
<user>
<id>2</id>
<name>xyz</name>
</user>
</root>
I tried using xml.etree.ElementTree but I couldn't figure it out.