def METHOD_NAME(tags) -> Optional[DatasetTag]:
    """Prompt user to chose a tag or <HEAD>."""
    tags = sorted(tags, key=lambda t: t.date_created)
    text_prompt = "Tag to export: \n\n<HEAD>\t[1]\n"
    text_prompt += "\n".join(f"{t.name}\t[{i}]" for i, t in enumerate(tags, start=2))
    text_prompt += "\n\nTag"
    while True:
        selection = communication.prompt(text_prompt, type=int, default=1)
        if selection == 1:
            return None
        elif 1 < selection <= len(tags) + 1:
            return tags[selection - 2]
        communication.warn(f"{selection} is not a valid choice. Selected value has to be between 1 and {len(tags) + 1}")