I need to escape special characters in an invalid XML file which is about 5000 lines long. Here's an example of the XML that I have to deal with:
name & surname
name@name.org
Here the problem is the character "&" in the name. How would you escape special characters like this with a Python library? I didn't find a way to do it with BeautifulSoup.