I'm currently using Element Tree to parse some XML and some of it has multiple repeated name/value pairs that look like this. What i'm trying to do is extract the elements of interest i.e. gender = male and colour = red but I can't seem to do this using findall on it's own because of the structure. How do I extract these elements? I thought the correct logic would be to look for a child node where I can find child.text = 'gender' etc then go ahead and print out the name/values from that child node. What is the best way to do this?
<a:characteristic>
<name>gender</name>
<value>male</value>
</a:characteristic>
<a:characteristic>
<name>age</name>
<value>30</value>
</a:characteristic>
<a:characteristic>
<name>colour</name>
<value>red</value>
</a:characteristic>
<a:characteristic>
<name>language</name>
<value>python</value>
</a:characteristic>