Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The declarative nature of XSLT programming and the complex nature of many XML source documents often leads to stylesheets that make extensive use of template rules.
In some cases, however, you will want to use a more imperative style of programming, exercising specific control over the processor. One of these cases is when you want to use logic to test for simple or complex conditions, and direct processing accordingly. Another is when the source data is repetitive in nature, and the most straightforward thing to do is iterate over it.