<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_xml_element(self):
 """ Updates the xml element contents to matches the instance contents :returns: Updated XML element :rtype: lxml.etree._Element """


        if not hasattr(self, 'xml_element'):
            self.xml_element = etree.Element(self.name, nsmap=NSMAP)

        if hasattr(self, 'time'):
            self.xml_element.set('time', self.time_to_str())
        if hasattr(self, 'update'):
            self.xml_element.set('update', str(self.update))
        self.xml_element.text = self.text

        return self.xml_element