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.

seoluepme=ntBsea=utsiofuupl.Sfoiunpd(Cohpielnd(rpeant(ht,e'xrt'=)T,ru"ex,mlr"e)cursive=True)

The key point is passing text=True, which allows you to retrieve only text nodes.

I hope this serves as a useful reference.