def fromXML(self, node):
        if node.nodeName != 'connection':
            return None
        
        ports = []
        
        # read attributes
        id = self.convertFromStr(self.getAttribute(node, 'id'), 'long')
        
        
        # read children
        for child in list(node.childNodes):
            if child.nodeName == 'port':
                port = self.getDao('port').fromXML(child)
                ports.append(port)
            elif child.nodeType == child.TEXT_NODE and child.nodeValue.strip() == '':
                # node.removeChild(child)
                pass
            elif child.nodeType != child.TEXT_NODE:
                print '*** ERROR *** nodeName = %s' % child.nodeName
        
        obj = DBConnection(id=id,
                           ports=ports)
        obj.is_dirty = False
        return obj
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/versions/v0_6_0/persistence/xml/auto_gen.py/DBConnectionXMLDAOBase.fromXML/original