<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def xmlAddParams(parentelement, params):
 """Generates new mzML parameter xml elements and adds them to the 'parentelement' as xml children elements. :param parentelement: :class:`xml.etree.Element`, an mzML element :param params: a list of mzML parameter tuples ('cvParam', 'userParam' or 'referencableParamGroup') """

    if not params:
        return None
    for param in params:
        if len(param) == 3:
            cvAttrib = {'cvRef': param[0].split(':')[0], 'accession': param[0],
                        'name':oboTranslator.getNameWithId(param[0])
                        }
            if param[1]:
                cvAttrib.update({'value': param[1]})
            else:
                cvAttrib.update({'value': ''})
            if param[2]:
                unitName = oboTranslator.getNameWithId(param[2])
                cvAttrib.update({'unitAccession': param[2],
                                 'unitCvRef': param[2].split(':')[0],
                                 'unitName': unitName
                                 })
            paramElement = ETREE.Element('cvParam', **cvAttrib)
        elif len(param) == 4:
            userAttrib = {'name': param[0]}
            if param[1]:
                userAttrib.update({'value': param[1]})
            else:
                userAttrib.update({'value': ''})
            if param[2]:
                userAttrib.update({'unitAccession': param[2],
                                   'unitCvRef': param[2].split(':')[0]
                                   })
            if param[3]:
                userAttrib.update({'type': param[3]})
            paramElement = ETREE.Element('userParam', **userAttrib)
        elif param[0] == 'ref':
            refAttrib = {'ref': param[1]}
            paramElement = ETREE.Element('referenceableParamGroupRef',
                                         **refAttrib
                                         )
        parentelement.append(paramElement)