An XSLT stylesheet is an XML document. The root element is <xsl:stylesheet> and the elements inside the root are primarily <xsl:template> elements. When you apply an XSLT stylesheet to an XML document (such as by running it through the <oXygen/> debugger), the stylesheet finds the document node in the XML (above the root element; every XML document has one) and looks for a template rule to process it. It then follows the instructions it receives inside that template rule, which may involve generating output, applying template rules to other elements, etc. When it runs out of things to do, it ends.
XSLT is a declarative language, which means that the template rules describe what happens if and when an element of a particular type happens to float past. The programming languages you may have used in the past are likely to have been procedural languages, which describe what to do in order. The XSLT paradigm is very different. For example, the order of the template rules in your stylesheet doesn’t matter because the rules don’t apply in any particular order; they just fire whenever the element to which they apply happens to show up. Elements "show up" most often when they’re summoned by an <xsl:apply-templates/> element inside another template. ·