<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def save_xml(self, doc, element):
        '''Save this component into an xml.dom.Element object.'''
        element.setAttributeNS(XSI_NS, XSI_NS_S + 'type', 'rtsExt:component_ext')
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'id', self.id)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'pathUri', self.path_uri)
        if self.active_configuration_set:
            element.setAttributeNS(RTS_NS, RTS_NS_S + 'activeConfigurationSet',
                                   self.active_configuration_set)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'instanceName',
                               self.instance_name)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'compositeType',
                               comp_type.to_string(self.composite_type))
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'isRequired',
                               str(self.is_required).lower())
        if self.comment:
            element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'comment',
                                   self.comment)
        element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'visible',
                               str(self.visible).lower())
        for port in self.data_ports:
            new_element = doc.createElementNS(RTS_NS, RTS_NS_S + 'DataPorts')
            port.save_xml(doc, new_element)
            element.appendChild(new_element)
        for port in self.service_ports:
            new_element = doc.createElementNS(RTS_NS,
                                              RTS_NS_S + 'ServicePorts')
            port.save_xml(doc, new_element)
            element.appendChild(new_element)
        for cs in self.configuration_sets:
            new_element = doc.createElementNS(RTS_NS,
                                              RTS_NS_S + 'ConfigurationSets')
            cs.save_xml(doc, new_element)
            element.appendChild(new_element)
        for ec in self.execution_contexts:
            new_element = doc.createElementNS(RTS_NS,
                                              RTS_NS_S + 'ExecutionContexts')
            ec.save_xml(doc, new_element)
            element.appendChild(new_element)
        for p in self.participants:
            new_element = doc.createElementNS(RTS_NS,
                                              RTS_NS_S + 'Participants')
            p.save_xml(doc, new_element)
            element.appendChild(new_element)
        new_element = doc.createElementNS(RTS_EXT_NS,
                                          RTS_EXT_NS_S + 'Location')
        self._location.save_xml(doc, new_element)
        element.appendChild(new_element)
        for p in self.properties:
            new_prop_element = doc.createElementNS(RTS_EXT_NS,
                                                   RTS_EXT_NS_S + 'Properties')
            properties_to_xml(new_prop_element, p, self.properties[p])
            element.appendChild(new_prop_element)