  Recent data gathered and triggered by the SWIFT satellite have greatly
improved our knowledge of long-duration gamma ray bursts (GRBs) and X-ray
flashes (XRFs). This is particularly the case for the X-ray data at all times.
We show that the entire X-ray observations are in excellent agreement with the
predictions of the `cannonball' model of GRBs and XRFs, which are based on
simple physics and were published long before the launch of SWIFT. Two
mechanisms underlie these predictions: inverse Compton scattering and
synchrotron radiation, generally dominant at early and late times,
respectively. The former mechanism provides a unified description of the
gamma-ray peaks, X-ray flares and even the optical `humps' seen in some
favourable cases; i.e. their very different durations, fluxes and peak-times
are related precisely as predicted. The observed smooth or bumpy fast decay of
the X-ray light curve is correctly described case-by-case, in minute detail.
The `canonical' X-ray plateau, as well as the subsequent gradual steepening of
the afterglow to an asymptotic power-law decay, are as foretold. So are the
chromatic and achromatic properties of the light-curves.
