The mechanisms described in Getting Started with XSL provide template-driven transformations. This indicates that the output template drives the transformation process, pulling in data from the XML tree and inserting it into the template. This works well when the data has a fairly simple and homogeneous structure. If you know what the output structure should be, use the template-driven model.
XSL also provides mechanisms for data-driven transformations, where the output is assembled from template fragments based on the structure of the input document. This is especially useful for XML that represents complex data structures or documents, as shown in Handling Documents and Irregular Data. If you only know what types of elements you might be encountering in the XML source, but not their order, parentage, or relationship to other elements, use the data-driven model.
Relevant topics:
Further information can be found in the related topic: