#TODO: docstring

    :params precursorList: #TODO: docstring

    :returns: #TODO: docstring

def xmlGenPrecursorList(precursorList):
    """ #TODO: docstring

    :params precursorList: #TODO: docstring

    :returns: #TODO: docstring
    """
    numEntries = len(precursorList)
    xmlPrecursorList = ETREE.Element('precursorList',
                                     {'count': str(numEntries)}
                                     )
    for precursor in precursorList:
        #Note: no attributes for external referencing supported
        precursorAttrib = {}
        if precursor['spectrumRef'] is not None:
            precursorAttrib.update({'spectrumRef': precursor['spectrumRef']})
        xmlPrecursor = ETREE.Element('precursor', precursorAttrib)

        #Add isolationWindow element
        if precursor['isolationWindow'] is not None:
            xmlIsolationWindow = ETREE.Element('isolationWindow')
            maspy.xml.xmlAddParams(xmlIsolationWindow,
                                   precursor['isolationWindow']
                                   )
            xmlPrecursor.append(xmlIsolationWindow)

        #Add selectedIonList element
        numSelectedIons = len(precursor['selectedIonList'])
        if numSelectedIons > 0:
            xmlSelectedIonList = ETREE.Element('selectedIonList',
                                               {'count': str(numSelectedIons)}
                                               )
            for selectedIon in precursor['selectedIonList']:
                xmlSelectedIon = ETREE.Element('selectedIon')
                maspy.xml.xmlAddParams(xmlSelectedIon, selectedIon)
                xmlSelectedIonList.append(xmlSelectedIon)
            xmlPrecursor.append(xmlSelectedIonList)

        #Add activation element
        xmlActivation = ETREE.Element('activation')
        maspy.xml.xmlAddParams(xmlActivation, precursor['activation'])
        xmlPrecursor.append(xmlActivation)


        xmlPrecursorList.append(xmlPrecursor)
    return xmlPrecursorList