title: Add sub-elements to newly created elements in python elementtree
body: <p>I am trying to add the following subtree to an element 'Drugs' in an xml file using elementtree in Python based on the data in CSV file:</p>
  
  <pre><code>&lt;Drug&gt;
       &lt;DrugID&gt;1&lt;DrugID&gt;
       &lt;Dose&gt;40&lt;/Dose&gt;
       &lt;Unit&gt;mg&lt;/Unit&gt;
  &lt;/Drug&gt;
  &lt;Drug&gt;
       &lt;DrugID&gt;3&lt;DrugID&gt;
       &lt;Dose&gt;1&lt;/Dose&gt;
       &lt;Unit&gt;g&lt;/Unit&gt;
  &lt;/Drug&gt;
  </code></pre>
  
  <p>The thing is once I have created the Drug element, how do I reference it to use the append function? <code>element.append()</code> as I understand it needs element to be a direct reference to the parent. If I use <code>.find()</code> when adding the second drug, I may instead get a reference to the first drug.</p>
  
  <p>I am cycling through each line of CSV while doing this so that's why I'd rather add element by element rather than appending a subtree to the element Drugs.</p>