  We propose a star-quake model to understand X-ray flares of both long and
short Gamma-ray bursts (GRBs) in a solid quark star regime. Two kinds of
central engines for GRBs are available if pulsar-like stars are actually
(solid) quark stars, i.e., the SNE-type GRBs and the SGR-type GRBs. It is found
that a quark star could be solidified about 10^3 to 10^6 s later after its
birth if the critical temperature of phase transition is a few MeV, and then a
new source of free energy (i.e., elastic and gravitational ones, rather than
rotational or magnetic energy) could be possible to power GRB X-ray flares.
