I am trying to find the deepest-nested children element of each element in an xml tree. I am currently using the lxml library, specifically etree.
I am using the following xml code as an example:
<item>
<a1>value1</a1>
<a2>value2</a2>
<a3>value3</a3>
<a4>
<a11>value222</a11>
<a22>value22</a22>
</a4>
</item>
I would like the output to show that the a1, a2 and a3 elements have no child elements and that a11 and a22 are the deepested nested children of the a4 element.