title: How to set ElementTree Element text field in the constructor
body: <p>How do I set the text field of of ElementTree Element from its constructor? Or, in the code below, why is the second print of root.text None?</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  
  root = ET.fromstring("&lt;period units='months'&gt;6&lt;/period&gt;")
  ET.dump(root)
  print root.text
  
  root=ET.Element('period', {'units': 'months'}, text='6')
  ET.dump(root)
  print root.text
  
  root=ET.Element('period', {'units': 'months'})
  root.text = '6'
  ET.dump(root)
  print root.text
  </code></pre>
  
  <p>Here the output:</p>
  
  <pre><code>&lt;period units="months"&gt;6&lt;/period&gt;
  6
  &lt;period text="6" units="months" /&gt;
  None
  &lt;period units="months"&gt;6&lt;/period&gt;
  6
  </code></pre>