There are tons of libraries out there for processing XML in Python.
One of the painpoints I found while using ElementTree is that the XML is written out in a single line instead of a nice pretty format.
Apparently the best way to prettify it is using the minidom library.
- Checkout the ‘prettify’ method in this code, and
- How its being used in the editXML method. (relevant files : appt, updated)