I'm trying to add the xml-stylesheet tag in front of an existing XML file using python.
Eg. I'm trying to add
<?xml-stylesheet type="text/xsl" href="audit_stylesheet.xsl" ?>
to the beginning of my XML file.
If you change your line to
"<?xml-stylesheet type=\"text/xsl\" href=\"audit_stylesheet.xsl\" ?>"
and use this https://stackoverflow.com/a/5917395/4843078 you should be good to go