code: def _write_plist(self, root):
          
          # prettify the XML
          indent_xml(root)
  
          tree = ElementTree.ElementTree(root)
          with open(self.preferences_file, "w") as prefs_file:
              prefs_file.write(
                  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                  "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" "
                  "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
                  "<plist version=\"1.0\">\n")
              tree.write(prefs_file, xml_declaration=False, encoding="utf-8")
              prefs_file.write("</plist>")
docs: Write plist file based on our generated tree.