title: How to read the value of an XML tag having attributes using minidom
body: <p>I have an XML which looks like this.</p>
  
  <pre><code>&lt;nb:myelement param='oxygen'&gt;Value&lt;/nb:element&gt;
  </code></pre>
  
  <p>I am using the following python code.</p>
  
  <pre><code>for sub in dom.getElementsByTagName('nb:myelement'):
     if(sub.getAttributeNode("param").nodeValue == 'oxygen'):
        value = sub.getElementsByTagName('nb:myelement')[0].toxml()
  </code></pre>
  
  <p>But the last line is throwing an <code>index out of range execption</code>. How do I get the 'value' enclosed by a tag that also has attributes?</p>