XML to list of dict parsing

[ permalink ] [ download ]
from lxml import etree
coords = etree.parse("/path/to/your/xml/file").getroot()
coords_list = []
for coord in coords:
        this = {}
        for child in coord.getchildren():
            this[child.tag] = child.text
        coords_list.append(this)
hits counter