lxml is *the* Python XML parser for performance, but yeah, memory can be a killer.
Pro tip: Use `iterparse()` with `clear()` to free memory as you go. Like:
```python
for event, elem in lxml.etree.iterparse('bigfile.xml'):
# process elem
elem.clear()
```
Also, avoid `xpath` on huge trees—it’s slow.
Pro tip: Use `iterparse()` with `clear()` to free memory as you go. Like:
```python
for event, elem in lxml.etree.iterparse('bigfile.xml'):
# process elem
elem.clear()
```
Also, avoid `xpath` on huge trees—it’s slow.
