I'm using BeautifulSoup to make changes to an XML file, but I noticed that if I read in the file, put it into the constructor, and just spit it back out without making any changes to it, BeautifulSoup already made some changes to the code. For example, tag and attribute names are all lowercase, and the order of attributes in a tag are changed.
I know pragmatically this ought not to be an issue but the program that has to read the XML file is very nitpicky and won't accept these changes. I've found I can make changes using normal string operations without BeautifulSoup but this is inconvenient.
Is there a way to prevent BeautifulSoup from making changes to the XML upon reading it?