title: Reading XML using Python minidom and iterating over each node
body: <p>I have an XML structure that looks like the following, but on a much larger scale:</p>
  
  <pre><code>&lt;root&gt;
      &lt;conference name='1'&gt;
          &lt;author&gt;
              Bob
          &lt;/author&gt;
          &lt;author&gt;
              Nigel
          &lt;/author&gt;
      &lt;/conference&gt;
      &lt;conference name='2'&gt;
          &lt;author&gt;
              Alice
          &lt;/author&gt;
          &lt;author&gt;
              Mary
          &lt;/author&gt;
      &lt;/conference&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>For this, I used the following code:</p>
  
  <pre><code>dom = parse(filepath)
  conference=dom.getElementsByTagName('conference')
  for node in conference:
      conf_name=node.getAttribute('name')
      print conf_name
      alist=node.getElementsByTagName('author')
      for a in alist:
          authortext= a.nodeValue
          print authortext
  </code></pre>
  
  <p>However, the authortext that is printed out is 'None.' I tried messing around with using variations like what is below, but it causes my program to break.</p>
  
  <pre><code>authortext=a[0].nodeValue
  </code></pre>
  
  <p>The correct output should be:</p>
  
  <pre><code>1
  Bob
  Nigel
  2
  Alice
  Mary
  </code></pre>
  
  <p>But what I get is:</p>
  
  <pre><code>1
  None
  None
  2
  None
  None
  </code></pre>
  
  <p>Any suggestions on how to tackle this problem?</p>