def save_xml(self, doc, element):
        '''Save this data port into an xml.dom.Element object.'''
        element.setAttributeNS(XSI_NS, XSI_NS_S + 'type', 'rtsExt:dataport_connector_ext')
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'connectorId',
                               self.connector_id)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'name', self.name)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'dataType', self.data_type)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'interfaceType',
                               self.interface_type)
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'dataflowType',
                               self.data_flow_type)
        if self.subscription_type:
            element.setAttributeNS(RTS_NS, RTS_NS_S + 'subscriptionType',
                                   self.subscription_type)
        if self.push_interval != 0.0:
            element.setAttributeNS(RTS_NS, RTS_NS_S + 'pushInterval',
                                   str(self.push_interval))
        if self.comment:
            element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'comment',
                                   self.comment)
        if self.visible != True:
            element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'visible',
                                   str(self.visible).lower())
        new_element = doc.createElementNS(RTS_NS, RTS_NS_S + 'sourceDataPort')
        self.source_data_port.save_xml(doc, new_element)
        element.appendChild(new_element)
        new_element = doc.createElementNS(RTS_NS, RTS_NS_S + 'targetDataPort')
        self.target_data_port.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)