I don't understand your problem. If you have the list
L = [('A', 1), ('B', 2), ('C', 3), ('D', 4),('A', 5), ('B', 6), ('C', 7), ('D', 8)]
and you want a excel sheet such as
A B C D A B C D
1 2 3 4 5 6 7 8
you can do either
writer.writerows(zip(*L))
or
writer.writerow[(k for k, v in L)]
writer.writerow([v for k, v in L])
and of course, in your case, do first
L = list(flatten_dict(root))
All this will work very well as long as you dont have very large xml files (but in this case, the code can be adapted)