>>> s = '<entry xmlns:testns="https://example.org"> <testns:foo> <testns:bar url="http://example.org/1" /> <testns:bar url="http://example.org/2" /></testns:foo> </entry>'
>>> print(xmltodict.parse(s, process_namespaces=True, dict_constructor=dict))
{'entry': {'https://example.org:foo': {'https://example.org:bar': [{'@url': 'http://example.org/1', '@xmlns': OrderedDict([('testns', 'https://example.org')])}, {'@url': 'http://example.org/2'}]}}}
>>> pprint(xmltodict.parse(s, process_namespaces=True, dict_constructor=dict))
{'entry': {'https://example.org:foo': {'https://example.org:bar': [{'@url': 'http://example.org/1',
'@xmlns': OrderedDict([('testns',
'https://example.org')])},
{'@url': 'http://example.org/2'}]}}}