code: def xmlAddParams(parentelement, params):
      
      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)
docs: 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')