title: Parsing XML in Python with multiple tags
body: <p>I'm trying to parse an XML file.<br>
  I succeeded at parsing tags at the upper layer, but now I have a tag within a tag and I'm not getting the correct output.</p>
  
  <p><strong>XML FILE:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;Stations&gt;
      &lt;Station&gt;
      &lt;Code&gt;HT&lt;/Code&gt;
      &lt;Type&gt;knooppuntIntercitystation&lt;/Type&gt;
      &lt;Namen&gt;
      &lt;Kort&gt;Den Bosch&lt;/Kort&gt;
      &lt;Middel&gt;'s-Hertogenbosch&lt;/Middel&gt;
      &lt;Lang&gt;'s-Hertogenbosch&lt;/Lang&gt;
      &lt;/Namen&gt;
      &lt;Land&gt;NL&lt;/Land&gt;
      &lt;Synoniemen&gt;
      &lt;Synoniem&gt;Hertogenbosch ('s)&lt;/Synoniem&gt;
      &lt;Synoniem&gt;Den Bosch&lt;/Synoniem&gt;
      &lt;/Synoniemen&gt;
      &lt;/Station&gt;
      &lt;Station&gt;
      &lt;Code&gt;ALMO&lt;/Code&gt;
      &lt;Type&gt;stoptreinstation&lt;/Type&gt;
      &lt;Namen&gt;
      &lt;Kort&gt;Oostvaard&lt;/Kort&gt;
      &lt;Middel&gt;Oostvaarders&lt;/Middel&gt;
      &lt;Lang&gt;Almere Oostvaarders&lt;/Lang&gt;
      &lt;/Namen&gt;
      &lt;Land&gt;NL&lt;/Land&gt;
      &lt;Synoniemen&gt;
      &lt;/Synoniemen&gt;
      &lt;/Station&gt;
      &lt;Station&gt;
      &lt;Code&gt;ATN&lt;/Code&gt;
      &lt;Type&gt;stoptreinstation&lt;/Type&gt;
      &lt;Namen&gt;
      &lt;Kort&gt;Aalten&lt;/Kort&gt;
      &lt;Middel&gt;Aalten&lt;/Middel&gt;
      &lt;Lang&gt;Aalten&lt;/Lang&gt;
      &lt;/Namen&gt;
      &lt;Land&gt;NL&lt;/Land&gt;
      &lt;Synoniemen&gt;
      &lt;/Synoniemen&gt;
      &lt;/Station&gt;
      &lt;Station&gt;
      &lt;Code&gt;ASA&lt;/Code&gt;
      &lt;Type&gt;intercitystation&lt;/Type&gt;
      &lt;Namen&gt;
      &lt;Kort&gt;Amstel&lt;/Kort&gt;
      &lt;Middel&gt;Amsterdam Amstel&lt;/Middel&gt;
      &lt;Lang&gt;Amsterdam Amstel&lt;/Lang&gt;
      &lt;/Namen&gt;
      &lt;Land&gt;NL&lt;/Land&gt;
      &lt;Synoniemen&gt;
      &lt;/Synoniemen&gt;
      &lt;/Station&gt;
      &lt;/Stations&gt;
  </code></pre>
  
  <p><strong>My python function:</strong></p>
  
  <pre><code>import xml.etree.ElementTree
  
  e = xml.etree.ElementTree.parse('info.xml').getroot()
  
  for stationsnamens in e.findall('Station'):
      try:
          syn = stationsnamens.find('Synoniemen/Synoniem').text
          print(syn)
      except:
          print(Exception)
  </code></pre>
  
  <p>I'm trying to print every <code>Synoniemen</code> field there is, but only if it exists. Also, the 'Code' needs to be printed.  </p>
  
  <p><strong>Output Format:</strong>  </p>
  
  <pre><code>{Code}: {Synoniemen}
  </code></pre>