XSLT 2.0 Sequence

Where XSLT 1.0 has result-tree-fragments (RTF), XSLT 2.0 has sequences. With, XSLT 1.0 you need extension functions, like node-set(), to do anything with RTFs. Now, with XSLT 2.0, you use XPath expressions on sequences and you can apply templates to sequences too. The XSLT 2.0 sequence instruction constructs sequences.

An example

Here's a transform that's got some sequences.

The variable seq is a sequence that has two sequence instructions. One sequence instruction constructs a sequence of character nodes selected from Hamlet. Another sequence instruction constructs a sequence of characters from Othello, as atomic values. The variable seq has a sequence of nodes for characters from King Lear too.

And here's the output, which lists all the characters from Hamlet, King Lear and Othello, sorted in alphabetic order, just in case you ever wanted to do that.