for child in prop.findall('*'):
    if 'name' in child.tag:
        key = child.text
if 'value' in child.tag:
    val = child.text
if val and key:
    mapping[key] = val
return mapping
pomFile = xml.parse('pom.xml')
root = pomFile.getroot()
mappings = getMappings(root)
print(mappings)
Reading Maven Pom xml in Python