The Hamiltonian dynamics associated to classical, planar, Heisenberg XY models is investigated for two- and three-dimensional lattices. Besides the conventional signatures of phase transitions, here obtained through time averages of thermodynamical observables in place of ensemble averages, qualitatively new information is derived from the temperature dependence of Lyapunov exponents. A Riemannian geometrization of newtonian dynamics suggests to consider other observables of geometric meaning tightly related with the largest Lyapunov exponent. The numerical computation of these observables - unusual in the study of phase transitions - sheds a new light on the microscopic dynamical counterpart of thermodynamics also pointing to the existence of some major change in the geometry of the mechanical manifolds at the thermodynamical transition. Through the microcanonical definition of the entropy, a relationship between thermodynamics and the extrinsic geometry of the constant energy surfaces $\Sigma_E$ of phase space can be naturally established. In this framework, an approximate formula is worked out, determining a highly non-trivial relationship between temperature and topology of the $\Sigma_E$. Whence it can be understood that the appearance of a phase transition must be tightly related to a suitable major topology change of the $\Sigma_E$. This contributes to the understanding of the origin of phase transitions in the microcanonical ensemble.