My xml looks like below.
<RootTag xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Branch>
<BranchID>100</BranchID>
<Child>
<policy1>hello</policy1>
<policy2>how are you</policy2>
</Child>
<Child>
<policy1>hello1</policy1>
<policy2>how are you1</policy2>
</Child>
</Branch>
<Branch>
<BranchID>200</BranchID>
<Child>
<policy1>I am good</policy1>
<policy2>how about you</policy2>
</Child>
<Child>
<policy1>I am good1</policy1>
<policy2>how about you1</policy2>
</Child>
</Branch>
</RootTag>
I tried using getiterator(beacuse I'm in python 2.6) to get all the elements. I am able to flatten them but the parent tag(BranchID) values should be present in all the rows of its child.
Output expected:
BranchID,policy1,policy2
100,hello,how are you
100,hello1,how are you1
200,I am good,how about you
200,I am good1,how about you1