I'm using the Element tree library to modify an xml file and then convert the element tree back to xml.
In the process of doing so the xml version changes (1.1 -> 1.0).
However, I cannot perform my necessary rest calls to the Jenkins job because of this flawed xml file.
config_xml = server.get_job_config("Automation Enhancement Template")
root = xml.etree.ElementTree.fromstring(config_xml)
do some manipulation on element tree. Now convert back to xml file
xmlstr = ET.tostring(tree._root, encoding="UTF-8", method='xml')
Here is the difference between the original config file vs the edited
<?xml version='1.1' encoding='UTF-8'?>
<?xml version='1.0' encoding='UTF-8'?>
The version is hard coded, so build a custom fork of ElementTree\SimpleXMLWriter.py py-elementtree/elementtree/SimpleXMLWriter.py