We analyse a natural edge exchange Markov chain on the set of spanning trees of an undirected graph by the method of multicommodity flows. The analysis is then refined to obtain a canonical path analysis. The construction of the flow and of the canonical paths is based on related path constructions in a paper of Cordovil and Moreira (1993) on block matroids. The estimates of the congestion measure imply a polynomial bound on the mixing time. The canonical paths for spanning trees also yield polynomial time mixing rates for some related Markov chains on the set of forests with roots and on the set of connected spanning subgraphs. We obtain a parametric class of stationary distributions from which we can efficiently sample. For rooted forests this includes the uniform distribution. For connected spanning subgraphs the uniform distribution is not covered.