In this paper we study arbitrary classical W algebras related to embed
dings of sl2 in a Lie algebra g. We will give a simple general formula
for all W transformations, which will enable us to construct the cova
riant action for general classical W gravity. It turns out that this c
ovariant action is nothing but a Legendre transform of the WZW action.
The same general formula provides a ''geometrical'' interpretation of
W transformations: they are just a homotopy contraction of ordinary g
auge transformations. This is used to argue that the moduli space rele
vant to W gravity is part of the moduli space of G-bundles over a Riem
ann surface.