  The theorem of factorisation forests shows the existence of nested
factorisations -- a la Ramsey -- for finite words. This theorem has important
applications in semigroup theory, and beyond. The purpose of this paper is to
illustrate the importance of this approach in the context of automata over
infinite words and trees. We extend the theorem of factorisation forest in two
directions: we show that it is still valid for any word indexed by a linear
ordering; and we show that it admits a deterministic variant for words indexed
by well-orderings. A byproduct of this work is also an improvement on the known
bounds for the original result. We apply the first variant for giving a
simplified proof of the closure under complementation of rational sets of words
indexed by countable scattered linear orderings. We apply the second variant in
the analysis of monadic second-order logic over trees, yielding new results on
monadic interpretations over trees. Consequences of it are new caracterisations
of prefix-recognizable structures and of the Caucal hierarchy.
