  We present a sample of 14 M dwarf stars observed with XMM-Newton and Chandra,
for which we also computed rotational periods from Kepler Two-Wheel (K2)
Mission light curves. We compiled X-ray and rotation data from the literature
and homogenized all data sets to provide the largest uniform sample of M dwarfs
(302 stars) for X-ray activity and rotation studies to date. We then fit the
relation between $L_{\rm x} - P_{\rm rot}$ using three different mass bins to
separate partially and fully convective stars. We found a steeper slope in the
unsaturated regime for fully convective stars and a nonconstant $L_{\rm x}$
level in the saturated regime for all masses. In the $L_{\rm x}/L_{\rm
bol}-R_{\rm O}$ space we discovered a remarkable double gap that might be
related to a discontinuous period evolution. Then we combined the evolution of
$P_{\rm rot}$ predicted by angular momentum evolution models with our new
results on the empirical $L_{\rm x} - P_{\rm rot}$ relation to provide an
estimate for the age decay of X-ray luminosity. We compare predictions of this
relationship with the actual X-ray luminosities of M stars with known ages from
100 Myr to a few billion years. We find remarkably good agreement between the
predicted $L_{\rm x}$ and the observed values for partially convective stars.
However, for fully convective stars at ages of a few billion years, the
constructed $L_{\rm x}-$age relation overpredicts the X-ray luminosity because
the angular momentum evolution model underpredicts the rotation period of these
stars. Finally, we examine the effect of different parameterizations for the
Rossby number ($R_{\rm O}$) on the shape of the activity-rotation relation in
$L_{\rm x}/L_{\rm bol}-R_{\rm O}$ space, and we find that the slope in the
unsaturated regime and the location of the break point of the dual power-law
depend sensitively on the choice of $R_{\rm O}$.
