def _xml_to_dict(xml):
    '''
    Helper function to covert xml into a data dictionary.

    xml
        The xml data to convert.
    '''
    dicts = {}
    for item in xml:
        key = item.tag.lower()
        idx = 1
        while key in dicts:
            key += six.text_type(idx)
            idx += 1
        if item.text is None:
            dicts[key] = _xml_to_dict(item)
        else:
            dicts[key] = item.text

    return dicts
def _xml_to_dict ( xml ) : dicts = { } for item in xml : key = item . tag . lower ( ) idx = 1 while key in dicts : key += six . text_type ( idx ) idx += 1 if item . text is None : dicts [ key ] = _xml_to_dict ( item ) else : dicts [ key ] = item . text return dicts
Helper function to covert xml into a data dictionary.

    xml
        The xml data to convert.