A Green's-function theory of antiferromagnetic short-range and long-range order (LRO) in the S = 1/2 quasi-two-dimensional easy-plane XXZ model is presented. As the main new result, two phase transitions due to the combined influence of spatial and spin anisotropy are found, where below the higher and lower Néel temperature there occurs LRO in the transverse and in both the transverse and longitudinal spin correlators, respectively. Comparing the theory with neutron-scattering data for the correlation length of La2CuO4, a very good agreement in the whole temperature dependence is obtained. Moreover, for La2CuO4, Sr2CuO2Cl2, and Ca0.85Sr0.15CuO2 the second phase with longitudinal LRO is predicted to appear far below room temperature.