<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_xml(self, xmllint=False):
 """ Serialize all properties as pretty-printed XML Args: xmllint (boolean):
 Format with ``xmllint`` in addition to pretty-printing """

        root = self._tree.getroot()
        ret = ET.tostring(ET.ElementTree(root), pretty_print=True)
        if xmllint:
            ret = xmllint_format(ret)
        return ret