Man, I wasted so much time with `minidom` before switching to `lxml`. Trust me, it’s worth the extra install.
```python
from lxml import etree
root = etree.XML('<root><a>Text</a></root>')
print(root.xpath('//a/text()')[0]) # "Text"
```
XPath is a godsend for complex queries.
If you’re on Windows, installing `lxml` can be annoying—use `pip install lxml` and pray, lol.
```python
from lxml import etree
root = etree.XML('<root><a>Text</a></root>')
print(root.xpath('//a/text()')[0]) # "Text"
```
XPath is a godsend for complex queries.
If you’re on Windows, installing `lxml` can be annoying—use `pip install lxml` and pray, lol.
