import xml.etree.ElementTree as ET def ParseXML(path_xml): """ Parses an XML File It is assumed, that packets are placed on the second hierarchical level and packetinformation encoded as attributes :param path_xml: Path to the XML File :return List of Dictionaries, each Dictionary contains the information for one packet """ tree = ET.parse(path_xml) root = tree.getroot() packets = [] for child in root: packets.append(child.attrib) return packets