Jak ustawić pole tekstowe ElementTree Element w konstruktorze

Jak ustawić pole tekstowe ElementTree Element na jego konstruktorze? Lub w poniższym kodzie, dlaczego jest drugi wydruk root.text Brak?

import xml.etree.ElementTree as ET

root = ET.fromstring("<period units='months'>6</period>")
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

Tutaj wyjście:

<period units="months">6</period>
6
<period text="6" units="months" />
None
<period units="months">6</period>
6

questionAnswers(2)

yourAnswerToTheQuestion