I've been trying to get the value of the ci-name element whose sibling RandomAttribute's value(text) is IMPORTANT. I'm a beginner to python and I'm trying using Python's inbuilt ElementTree.
Here's the sample XML:
<state>
<s-name>State 1</s-name>
<district>
<d-name>District 1</d-name>
<city>
<ci-name>City 1</ci-name>
<RandomAttribute>UN- IMPORTANT</RandomAttribute>
</city>
<city>
<ci-name>City 2</ci-name>
<RandomAttribute>NOT SO IMPORTANT</RandomAttribute>
</city>
<city>
<ci-name>City 3</ci-name>
<RandomAttribute>IMPORTANT</RandomAttribute>
</city>
</district>
</state>
Please help me out with this.