@classmethod
def getRecord(cls, node):
    """ fetches record name or query from datasource node

        :param node: datasource node
        :type node: :class:`lxml.etree.Element`
        :returns: record name or query
        :rtype: :obj:`str`
        """
    withRec = ['CLIENT', 'TANGO']
    withQuery = ['DB']
    if node.tag == 'datasource':
        dsource = node
    else:
        dsource = node.find('.//datasource')
    dstype = dsource.attrib['type']
    res = ''
    if dstype and dstype in withRec:
        host = None
        port = None
        dname = None
        rname = None
        member = None
        device = dsource.findall('device')
        if device is not None and len(device) > 0:
            host = device[0].get('hostname')
            port = device[0].get('port')
            dname = device[0].get('name')
            member = device[0].get('member')
        surfix = ''
        prefix = ''
        if member or member != 'attribute':
            if member == 'property':
                prefix = '@'
            elif member == 'command':
                surfix = '()'
        record = dsource.findall('record')
        if record is not None and len(record) > 0:
            rname = record[0].get('name')
            if rname:
                if dname:
                    if host:
                        if not port:
                            port = '10000'
                        res = '%s:%s/%s/%s%s%s' % (host, port, dname,
                            prefix, rname, surfix)
                    else:
                        res = '%s/%s%s%s' % (dname, prefix, rname, surfix)
                else:
                    res = rname
            return res
    elif dstype and dstype in withQuery:
        query = dsource.find('.//query')
        if len(query) and query.strip():
            return query.strip() or ''
    return res
