One model for applying style is to allow the process to run recursively, driven primarily by the document. A series of templates is created, such that there is a template to match each context, then these templates are recursively applied starting at the root of the document.
<xsl:template match="section/title"> <h2><xsl:apply-templates/></h2> </xsl:template>
There are two obstacles to overcome when using the recursive model, how to arbitrate between multiple patterns that match and how to process the same nodes in different contexts. These are solved by conflict resolution and modes, respectively.