The evolution of the 2006 outburst of the recurrent nova RS Ophiuchi was followed with 12 X-ray grating observations with Chandra and XMM-Newton. We present detailed spectral analyses using two independent approaches. From the best dataset, taken on day 13.8 after outburst, we reconstruct the temperature distribution and derive elemental abundances. We find evidence for at least two distinct temperature components on day 13.8 and a reduction of temperature with time. The X-ray flux decreases as a power-law, and the power-law index changes from -5/3 to -8/3 around day 70 after outburst. This can be explained by different decay mechanisms for the hot and cool components. The decay of the hot component and the decrease in temperature are consistent with radiative cooling, while the decay of the cool component can be explained by the expansion of the ejecta. We find overabundances of N and of alpha-elements, which could either represent the composition of the secondary that provides the accreted material or that of the ejecta. The N overabundance indicates CNO-cycled material. From comparisons to abundances for the secondary taken from the literature, we conclude that 20-40% of the observed nitrogen could originate from the outburst. The overabundance of the alpha-elements is not typical for stars of the spectral type of the secondary in the RS Oph system, and white dwarf material might have been mixed into the ejecta. However, no direct measurements of the alpha-elements in the secondary are available, and the continuous accretion may have changed the observable surface composition.