  A Hamiltonian dynamics is defined for the XY model by adding a kinetic energy
term. Thermodynamical properties (total energy, magnetization, vorticity)
derived from microcanonical simulations of this model are found to be in
agreement with canonical Monte-Carlo results in the explored temperature
region. The behavior of the magnetization and the energy as functions of the
temperature are thoroughly investigated, taking into account finite size
effects. By representing the spin field as a superposition of random phased
waves, we derive a nonlinear dispersion relation whose solutions allow the
computation of thermodynamical quantities, which agree quantitatively with
those obtained in numerical experiments, up to temperatures close to the
transition. At low temperatures the propagation of phonons is the dominant
phenomenon, while above the phase transition the system splits into ordered
domains separated by interfaces populated by topological defects. In the high
temperature phase, spins rotate, and an analogy with an Ising-like system can
be established, leading to a theoretical prediction of the critical temperature
$T_{KT}\approx 0.855$.
