If you’re allergic to external libs, here’s a hacky way with `ElementTree`:
```python
import xml.etree.ElementTree as ET
tree = ET.fromstring(xml_string)
data = {elem.tag: elem.text for elem in tree}
```
But it’s basic—won’t handle nesting or attributes well. xmltodict is better for that.
```python
import xml.etree.ElementTree as ET
tree = ET.fromstring(xml_string)
data = {elem.tag: elem.text for elem in tree}
```
But it’s basic—won’t handle nesting or attributes well. xmltodict is better for that.
