A set of similarity equations is derived to describe the hydrodynamics of transient X-ray lasers from slab plasmas generated by combined irradiation of nanosecond and picosecond laser pulses. By separating nanosecond and picosecond laser heating processes into different periods, analytical solutions are obtained for the similarity equations. The calculated results are in agreement with numerical simulations and experimental data.