The nonequilibrium critical dynamics of the two-dimensional XY model is inv
estigated numerically through Monte Carlo simulations and analytically in t
he spin-wave approximation. We focus in particular on the behaviour of the
two-time response and correlation functions and show that the ageing dynami
cs depends on the initial conditions. The presence of critical fluctuations
leads to nontrivial violations of the fluctuation-dissipation theorem appa
rently reminiscent of the three-dimensional Edwards-Anderson spin glass mod
el. We compute for this reason the finite-size overlap probability distribu
tion function and find that it is related to the finite-time fluctuation-di
ssipation ratio obtained in the out-of-equilibrium dynamics, provided that
the temperature is not very low.