I have the following node in an XML-document:
<state>
<soso value="3"/>
<good value="1"/>
<bad value="2"/>
<unknown value="0"/>
</state>
I need to sort its elements according to the value attribute's value, so that the result is the following:
<state>
<unknown value="0"/>
<good value="1"/>
<bad value="2"/>
<soso value="3"/>
</state>
How would one do it in python using libxml2?