def getXYZ(atoms, cart_coords):
    """
    Return a string of the molecule in the XYZ file format.
    """
    natom = len(atoms)
    xyz = ''
    for i in range(natom):
        xyz += '{:s}       {:.10f}     {:.10f}     {:.10f}'.format(atoms[i],cart_coords[3*i],cart_coords[3*i+1],cart_coords[3*i+2])
        if i != natom-1: xyz += '\n'
    return xyz