I use this code to parse xml. it works perfectly, except it is a recursive function.
def dictify(r,root=True): if root: return {r.tag : dictify(r, Fa