Write  Xdatcar class into a file
        Args:
            filename (str): Filename of output XDATCAR file.
            ionicstep_start (int): Starting number of ionic step.
            ionicstep_end (int): Ending number of ionic step.

def get_string(self, ionicstep_start=1,
                   ionicstep_end=None,
                   significant_figures=8):
        """
        Write  Xdatcar class into a file
        Args:
            filename (str): Filename of output XDATCAR file.
            ionicstep_start (int): Starting number of ionic step.
            ionicstep_end (int): Ending number of ionic step.
        """
        from pymatgen.io.vasp import Poscar
        if (ionicstep_start < 1):
            raise Exception('Start ionic step cannot be less than 1')
        if (ionicstep_end is not None and
                ionicstep_start < 1):
            raise Exception('End ionic step cannot be less than 1')
        latt = self.structures[0].lattice
        if np.linalg.det(latt.matrix) < 0:
            latt = Lattice(-latt.matrix)
        lines = [self.comment, "1.0", str(latt)]
        lines.append(" ".join(self.site_symbols))
        lines.append(" ".join([str(x) for x in self.natoms]))
        format_str = "{{:.{0}f}}".format(significant_figures)
        ionicstep_cnt = 1
        output_cnt = 1
        for cnt, structure in enumerate(self.structures):
            ionicstep_cnt = cnt + 1
            if ionicstep_end is None:
                if (ionicstep_cnt >= ionicstep_start):
                    lines.append("Direct configuration=" +
                                 ' ' * (7 - len(str(output_cnt))) + str(output_cnt))
                    for (i, site) in enumerate(structure):
                        coords = site.frac_coords
                        line = " ".join([format_str.format(c) for c in coords])
                        lines.append(line)
                    output_cnt += 1
            else:
                if ionicstep_start <= ionicstep_cnt < ionicstep_end:
                    lines.append("Direct configuration=" +
                                 ' ' * (7 - len(str(output_cnt))) + str(output_cnt))
                    for (i, site) in enumerate(structure):
                        coords = site.frac_coords
                        line = " ".join([format_str.format(c) for c in coords])
                        lines.append(line)
                    output_cnt += 1
        return "\n".join(lines) + "\n"