Im trying to write the xml file by ElementTree.write, and this function's writing mode is append, but i want to overwrite the file what should i do to realize this goal?
def write_xml(self, out_path: str):
xml = ET.ElementTree(self.__root)
xml.write(out_path)