We study the possibility of transforming quasi-monochromatic seeding X-ray radiation into an attosecond pulse train in the system composed of a resonant absorber (the plasma of hydrogen-like ions) and an active medium of a plasma-based X-ray laser (the plasma of identical ions in the excited state), which are modulated by the same optical field. In this case, the formation of pulses occurs in a modulated absorber, while the active medium is used for their subsequent amplification. It is shown that this approach significantly increases the energy of the pulses and improves their shape in comparison with the pulse formation directly in the modulated active medium of an X-ray laser. The obtained analytical solution shows that the pulse formation in the modulated absorber is due to the existence of a multifrequency structure of the resonant radiation, which propagates in the medium without absorption. It is shown, both analytically and numerically, that the spectraltemporal characteristics of the pulses are insensitive to changes in the optical thickness of each medium (absorbing and amplifying) over a wide range. The possibility of forming X-ray pulses with a wavelength of the order of 3.4 nm, having a duration of less than 200 as and a peak intensity exceeding 10 13 W/cm 2 , in the plasma of hydrogen-like C 5+ ions is shown.