Arc- and tree-preserving transformations