In the context of generalized geometry we first show how the Courant bracket helps to define connections with skew torsion and then investigate a five-dimensional invariant functional and its associated geometry, which involves three Courant-commuting sections of $T \bigoplus T\sp *$ . A Hamiltonian flow arising from this corresponds to a version of the Nahm equations, and we investigate the sixdimensional geometrical structure this describes.