  Let T be a tree with an action of a finitely generated group G. Given a
suitable equivalence relation on the set of edge stabilizers of T (such as
commensurability, co-elementarity in a relatively hyperbolic group, or
commutation in a commutative transitive group), we define a tree of cylinders
T_c. This tree only depends on the deformation space of T; in particular, it is
invariant under automorphisms of G if T is a JSJ splitting. We thus obtain
Out(G)-invariant cyclic or abelian JSJ splittings. Furthermore, T_c has very
strong compatibility properties (two trees are compatible if they have a common
refinement).
