  This paper studies a class of $D=n+2(\ge 6)$ dimensional solutions to
Lovelock gravity that is described by the warped product of a two-dimensional
Lorentzian metric and an $n$-dimensional Einstein space. Assuming that the
angular part of the stress-energy tensor is proportional to the Einstein
metric, it turns out that the Weyl curvature of an Einstein space must obey two
kinds of algebraic conditions. We present some exact solutions satisfying these
conditions. We further define the quasilocal mass corresponding to the
Misner-Sharp mass in general relativity. It is found that the quasilocal mass
is constructed out of the Kodama flux and satisfies the unified first law and
the monotonicity property under the dominant energy condition. Making use of
the quasilocal mass, we show Birkhoff's theorem and address various aspects of
dynamical black holes characterized by trapping horizons.
