#TODO: docstring

    :param xmlWriter: #TODO: docstring
    :param elementName: #TODO: docstring
    :param indexList: #TODO: docstring

def _writeIndexListElement(xmlWriter, elementName, indexList):
    """ #TODO: docstring

    :param xmlWriter: #TODO: docstring
    :param elementName: #TODO: docstring
    :param indexList: #TODO: docstring
    """
    if indexList:
        xmlIndex = xmlWriter.element('index', {'name': elementName})
        xmlIndex.__enter__()
        xmlWriter.write('\n')
        for offset, indexId in indexList:
            offsetElement = ETREE.Element('offset', {'idRef': indexId})
            offsetElement.text = str(offset)
            xmlWriter.write(offsetElement, pretty_print=True)
        xmlIndex.__exit__(None, None, None)
        xmlWriter.write('\n')