I had the opportunity to extract and process only text strings from XML files.
For this need, I was able to achieve it with the following script.
The key point is passing text=True, which allows you to retrieve only text nodes.
I hope this serves as a useful reference.