def children_are_mapping(trans, elem):
    """Child elements of elem are the key/value pairs.  tag name is
    key, value is inner text"""
    
    res = {}
    for i in elem:
        key = trans.tagnorm(i)
        if len(i):
            value = trans.from_elem(i)
        else:
            value = i.text

        res[key] =  value
        
    return res
Child elements of elem are the key/value pairs.  tag name is
    key, value is inner text
recipes/Python/511472_Simple_maps_and_lists_from_XML/recipe-511472.py