I have a xml tree and I would like to replace the sub elements in the xml structure. This is actual xml tree read from the file
xml_data = ET.parse('file1.xml')
<?xml version='1.0' encoding='UTF-8'?>
<call method="xxxx" callerName="xxx">
<credentials login="" password=""/>
<filters>
<accounts>
<account code="" ass="" can=""/>
</accounts>
</filters>
</call>
I'm expecting this format from looping the list
a = [1,23453, 3543,4354,3455, 6345]
<?xml version='1.0' encoding='UTF-8'?>
<call method="xxxx" callerName="xxx">
<credentials login="" password=""/>
<filters>
<accounts>
<account code="1" ass="34" can="yes"/>
<account code="23453" ass="34" can="yes"/>
<account code="3543" ass="34" can="yes"/>
<account code="4354" ass="34" can="yes"/>
<account code="3455" ass="34" can="yes"/>
<account code="6345" ass="34" can="yes"/>
</accounts>
</filters>
</call>
New to xml-parsing. Any help would be appreciated. Thanks in advance