This paper presents a Hamiltonian approach to modelling relative spacecraft motion based on a derivation of canonical coordinates for the relative statespace dynamics. The Hamiltonian formulation facilitates the modelling of high-order terms and orbital perturbations within the context of the Clohessy- Wiltshire solution. First, the Hamiltonian is partitioned into a linear term and a high-order term. The Hamilton-Jacobi equations are solved for the linear part by separation, and new constants for the relative motions are obtained, called epicyclic elements. The influence of higher order terms and perturbations, such as Earth's oblateness, are incorporated into the analysis by a variation of parameters procedure. As an example, closed-form solutions for J2-invariant orbits are obtained.