Dude, I feel you. XML can be a pain, but `lxml` is a lifesaver once you get the hang of it. It’s way faster than the built-in stuff and has better error handling.
Try this:
```python
from lxml import etree
doc = etree.parse('file.xml')
print(etree.tostring(doc, pretty_print=True))
```
If you’re dealing with messy XML, `lxml`’s `recover=True` option is a game-changer.
Also, the official docs are kinda dry, but Stack Overflow has tons of examples for parse XML Python.
Try this:
```python
from lxml import etree
doc = etree.parse('file.xml')
print(etree.tostring(doc, pretty_print=True))
```
If you’re dealing with messy XML, `lxml`’s `recover=True` option is a game-changer.
Also, the official docs are kinda dry, but Stack Overflow has tons of examples for parse XML Python.
