  We analyze several recently detected gamma-ray bursts (GRBs) with late X-ray
flares in the context of late internal shock and late external shock models. We
find that the X-ray flares in GRB 050421 and GRB 050502B originate from late
internal shocks, while the main X-ray flares in GRB 050406 and GRB 050607 may
arise from late external shocks. Under the assumption that the central engine
has two periods of activities, we get four basic types of X-ray light curves.
The classification of these types depends on which period of activities
produces the prompt gamma-ray emission (Type 1 and Type 2: the earlier period;
Type 3 and Type 4: the late period), and on whether the late ejecta catching up
with the early ejecta happens earlier than the deceleration of the early ejecta
(Type 1 and Type 3) or not (Type 2 and Type 4). We find that the X-ray flare
caused by a late external shock is a special case of Type 1. Our analysis
reveals that the X-ray light curves of GRBs 050406, 050421, and 050607 can be
classified as Type 1, while the X-ray light curve of GRB 050502B is classified
as Type 2. However, the X-ray light curve of GRB 050406 is also likely to be
Type 2. We also predict a long-lag short-lived X-ray flare caused by the inner
external shock, which forms when a low baryon-loading long-lag late ejecta
decelerates in the non-relativistic tail of an outer external shock driven by
an early ejecta.
