I want to get the name of a student for a particular detail like name, age, the complexity of gender. Suppose for the text "maths" or "married", I should get the name rick Grimes. For text "Female", I should get name Daryl. for attribute "low", I should get Maggie. I have read many docs but didn't find any function in XML python where we can traverse to any element and get the text of that based on other element text value or attribute. can someone help?
<students>
<student>
<name>Rick Grimes</name>
<age>35</age>
<subject complexity = "Medium">Maths</subject>
<gender>Male</gender>
<personal details>
<status>married</status>
</personal details>
</student>
<student>
<name>Daryl Dixon </name>
<age>33</age>
<subject complexity = "Small">Science</subject>
<gender>Female</gender>
<personal details>
<status>single</status>
</personal details>
</student>
<student>
<name>Maggie</name>
<age>36</age>
<subject complexity = "low">Arts</subject>
<gender>Others</gender>
</student>
</students>