I'm using xml.etree.ElementTree to parse xml file. I'm parsing xml file in the following way:
import xml.etree.ElementTree as ET
tree = ET.parse(options.xmlfile)
root = tree.getroot()
This is my xml file:
<rootElement>
<member>
<member_id>439854395435</member_id>
</member>
</rootElement>
Then I'm saving it:
tree.write(options.outcsvfile)
How can I make a copy of my tree to produce something like this:
<rootElement>
<member>
<member_id>439854395435</member_id>
</member>
<member>
<member_id>439854395435</member_id>
</member>
</rootElement>