title: Retrieving Tags in Geoname XML in Python
body: <p>I am looking to retrieve the timezoneId tag from the geoname api, by providing latitude and longitude. </p>
  
  <p><a href="http://api.geonames.org/timezone?lat=39.758720&amp;lng=116.041420&amp;username=demo" rel="nofollow">http://api.geonames.org/timezone?lat=39.758720&amp;lng=116.041420&amp;username=demo</a></p>
  
  <p>It is structured this way: </p>
  
  <pre><code>&lt;geonames&gt;
  &lt;timezone tzversion="tzdata2012c"&gt;
  &lt;countryCode&gt;CN&lt;/countryCode&gt;
  &lt;countryName&gt;China&lt;/countryName&gt;
  &lt;lat&gt;39.75872&lt;/lat&gt;
  &lt;lng&gt;116.04142&lt;/lng&gt;
  &lt;timezoneId&gt;Asia/Shanghai&lt;/timezoneId&gt;
  &lt;dstOffset&gt;8.0&lt;/dstOffset&gt;
  &lt;gmtOffset&gt;8.0&lt;/gmtOffset&gt;
  &lt;rawOffset&gt;8.0&lt;/rawOffset&gt;
  &lt;time&gt;2012-07-21 13:13&lt;/time&gt;
  &lt;sunrise&gt;2012-07-22 05:05&lt;/sunrise&gt;
  &lt;sunset&gt;2012-07-22 19:38&lt;/sunset&gt;
  &lt;/timezone&gt;
  &lt;/geonames&gt;
  </code></pre>
  
  <p>I am trying to get the element this way: </p>
  
  <pre><code>document=minidom.parseString(urllib2.urlopen(DATA_SRC).read())
  el=document.getElementsByTagName("geonames")[0].getElementsByTagName("timezone")[0].getElementsByTagName("timezoneId")[0]
  print el.firstChild.nodeValue
  </code></pre>
  
  <p>Apparently the getElementByTagName does not return any child... what am I doing wrong??</p>