'How can I find an element by name in a XML file

I am trying to parse ICD-10 codes and given a code, identify: description, parent, children (if any). Given this sample of the larger file I'm parsing:

A sample of the larger XML file I'm parsing

data = ```<diag>
<name>A00</name>
<desc>Cholera</desc>
<diag>
  <name>A00.0</name>
  <desc>Cholera due to Vibrio cholerae 01, biovar cholerae</desc>
  <inclusionTerm>
    <note>Classical cholera</note>
  </inclusionTerm>
</diag>
<diag>
  <name>A00.1</name>
  <desc>Cholera due to Vibrio cholerae 01, biovar eltor</desc>
  <inclusionTerm>
    <note>Cholera eltor</note>
  </inclusionTerm>
</diag>
<diag>
  <name>A00.9</name>
  <desc>Cholera, unspecified</desc>
</diag>
</diag>```

How can I write a code in python that gives me the specific element by searching its name? (example: I'm looking for the code A00.0 and I want the program to print the found A00.0 code, plus the description and the inclusionTerm.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source