def etree_to_dict(etree, namespace=None, tag_list=True, convert_camelcase=False):
    children = etree.getchildren()
    if len(children) == 0:
        return etree.text
    children_dict = {}
    for element in children:
        tag = element.tag
        if namespace is not None:
            tag = tag.replace(namespace, "")
        if convert_camelcase:
            tag = camelcase_to_underscore(tag)
        element_dict = etree_to_dict(element, namespace=namespace, tag_list=tag_list, convert_camelcase=convert_camelcase)
        if tag in children_dict:
            if not isinstance(children_dict[tag], list):
                children_dict[tag] = [children_dict[tag]]
            children_dict[tag].append(element_dict)
        else:
            if tag_list:    
                children_dict[tag] = [element_dict]
            else:
                children_dict[tag] = element_dict
    return children_dict
Save the message and send it out into the wide world.
dataset/ETHPy150Open wehriam/awspider/awspider/aws/lib.py/etree_to_dict--crossover with--dataset/ETHPy150Open bread-and-pepper/django-userena/userena/contrib/umessages/forms.py/ComposeForm.save