Solid Principles, Python.
file.write(f"<xml><name>{self.name}</name><salary>{self.salary}</salary></xml>") After implementing the save_as_xml method. IT opens the file emp.xml and writes XML to it. The file name is hard coded. class Employee: xml_filename = "emp.xml" def __init__(self, name, salary): self.name = name