Solid Principles, Python.
self.salary = salary def raise_salary(self, factor): return self.salary * factor def save_as_xml(self): with open(self.xml_filename, "w") as file: file.write(f"<xml><name>{self.name}</name><salary>{self.salary}</salary></xml>") To make it more flexible for users of the class, the file name will be