def METHOD_NAME(self, index: int) -> str:
    """Create an XYZ file of the geometry at the given index."""
    atomcoords = self.ccdata.atomcoords[index]
    existing_comment = "" if "comments" not in self.ccdata.metadata \
        else self.ccdata.metadata["comments"][index]
    # Create a comment derived from the filename and the index.
    if index == -1:
        geometry_num = len(self.ccdata.atomcoords)
    else:
        geometry_num = index + 1
    if self.jobfilename is not None:
        comment = f"{self.jobfilename}: Geometry {geometry_num}"
    else:
        comment = f"Geometry {geometry_num}"
    # Wrap the geometry number part of the comment in square brackets,
    # prefixing it with one previously parsed if it existed.
    if existing_comment:
        comment = f"{existing_comment} [{comment}]"
    else:
        comment = f"[{comment}]"
    atom_template = '{:3s} {:15.10f} {:15.10f} {:15.10f}'
    block = []
    block.append(self.natom)
    block.append(comment)
    for element, (x, y, z) in zip(self.element_list, atomcoords):
        block.append(atom_template.format(element, x, y, z))
    return '\n'.join(block)