An X-ray survey with the XMM-Newton telescope, XMM-XXL, has identified hundreds of galaxy groups and clusters in two 25 deg$^2$ fields. Combining spectroscopic and X-ray observations in one field, we determine how the kinetic energy of galaxies scales with hot gas temperature and also, by imposing prior constraints on the relative energies of galaxies and dark matter, infer a power-law scaling of total mass with temperature. Our goals are: i) to determine parameters of the scaling between galaxy velocity dispersion and X-ray temperature, $T_{rm 300kpc}$, for the halos hosting XXL-selected clusters, and; ii) to infer the log-mean scaling of total halo mass with temperature, $langle ln M_{200} , | , T, z rangle$. We apply an ensemble velocity likelihood to a sample of $> 1500$ spectroscopic redshifts within $132$ spectroscopically confirmed clusters with redshifts $z < 0.6$ to model, $langle ln sigma_{rm gal},|,T,zrangle$, where $sigma_{rm gal}$ is the velocity dispersion of XXL cluster member galaxies and $T$ is a 300 kpc aperture temperature. To infer total halo mass we use a precise virial relation for massive halos calibrated by N-body simulations along with a single degree of freedom summarizing galaxy velocity bias with respect to dark matter. For the XXL-N cluster sample, we find $sigma_{rm gal} propto T^{0.63pm0.05}$, a slope significantly steeper than the self-similar expectation of $0.5$. Assuming scale-independent galaxy velocity bias, we infer a mean logarithmic mass at a given X-ray temperature and redshift, $langleln (E(z) M_{200}/10^{14},{rm M}_{odot})|T,zrangle=pi+alpha ln(T/T_p )+betaln (E(z)/E(z_p) )$ using pivot values ${rm k}T_{p}=2.2,{rm keV}$ and $z_p=0.25$, with normalization $pi=0.45pm0.24$ and slope $alpha=1.89pm0.15$. We obtain only weak constraints on redshift evolution, $beta=-1.29pm1.14$.