title: Parse empty tag with ElementTree
body: <p>Trying to parse XML using ElementTree. I cannot figure out how to treat empty tags like <code>&lt;tag/&gt;</code>. If the tag is not present at all, <code>.find()</code> returns <code>None</code> and everything is fine. However with <code>&lt;tag\&gt;</code>, <code>.find()</code> returns something and the consequent attempt to call <code>text</code> fails with error:</p>
  
  <pre><code>TypeError: must be str, not NoneType
  </code></pre>
  
  <p>Failing example below. It will fail to parse the line <code>&lt;tl&gt;&lt;mpa/&gt;&lt;/tl&gt;</code></p>
  
  <pre><code>from xml.etree import ElementTree
  
  def getStuff(xml_message):
      message_tree = ElementTree.fromstring(xml_message)
      ns = {'a': 'http://www.example.org/a',
            'b': 'http://www.example.org/b'}          
      tls = message_tree.findall('.//b:tl', namespaces = ns)
  
      result, i = (0,)*2
  
      for tl in tls:
          i += 1     
          print("Item: " + str(i))
          mpa = tl.find("b:mpa", namespaces = ns)
          if mpa is None:
              result = result + 0
              print(" |--&gt; Is None, assigned 0.")
          else:
              print(" |--&gt; Is Something")
              # This is where things go terribly wrong
              print(" |--&gt; Tag Value: " + mpa.text)
              result = result  + int(mpa.text)    
      return result
  
  instr = """&lt;?xml version="1.0" standalone='no'?&gt;
  &lt;ncr xmlns="http://www.example.org/a"&gt;
    &lt;x xmlns="http://www.example.org/b"&gt;
        &lt;tl&gt;&lt;ec code="N"&gt;e1&lt;/ec&gt;&lt;/tl&gt;
        &lt;tl&gt;&lt;mpa&gt;0010&lt;/mpa&gt;&lt;/tl&gt;
        &lt;tl&gt;&lt;mpa/&gt;&lt;/tl&gt;
    &lt;/x&gt;
  &lt;/ncr&gt;
  """
  getStuff(instr)
  </code></pre>