>>> s = ' ' >>> 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'}]}}}