  Let $T^{ab}=T^{ba}=0$ be a system of differential equations for the
components of a metric tensor on $R^m$. Suppose that $T^{ab}$ transforms
tensorially under the action of the diffeomorphism group on metrics and that
the covariant divergence of $T^{ab}$ vanishes. We then prove that $T^{ab}$ is
the Euler-Lagrange expression some Lagrangian density provided that $T^{ab}$ is
of third order. Our result extends the classical works of Cartan, Weyl,
Vermeil, Lovelock, and Takens on identifying field equations for the metric
tensor with the symmetries and conservation laws of the Einstein equations.
