In multibody systems, it is common practice to approximate flexible components as beams or shells. More often than not, classical beam theories, such as the Euler–Bernoulli beam theory, form the basis of the analytical development for beam dynamics. The advantage of this approach is that it leads to simple kinematic representations of the problem: the beam's section is assumed to remain plane and its displacement field is fully defined by three displacement and three rotation components. While such an approach is capable of accurately capturing the kinetic energy of the system, it cannot adequately represent the strain energy. For instance, it is well known from Saint-Venant's theory for torsion that the cross-section will warp under torque, leading to a three-dimensional deformation state that generates a complex stress state. To overcome this problem, sectional stiffnesses are computed based on sophisticated mechanics of material theories that evaluate the complete state of deformation. These sectional stiffnesses are then used within the framework of a Euler–Bernoulli beam theory based on far simpler kinematic assumptions. While this approach works well for simple cross-sections made of homogeneous material, inaccurate predictions may result for realistic configurations, such as thin-walled sections, or sections comprising anisotropic materials. This paper presents a different approach to the problem. Based on a finite element discretization of the cross-section, an exact solution of the theory of three-dimensional elasticity is developed. The only approximation is that inherent to the finite element discretization. The proposed approach is based on the Hamiltonian formalism and leads to an expansion of the solution in terms of extremity and central solutions, as expected from Saint-Venant's principle.