Originally posted by Niraj Sheth:
XPath functions like position, last, size, current always applies to the current context ( and not to the node-set returned by the XPath expression ). So last() in "//CCC[last()]" doesn't apply to the node-set containing all CCC elements returned by //CCC but it applies to the current context for the every CCC element returned by the node-set. So this expression selects all CCC elements which are last in thier own cotext.
NOTE: The location path //para does not mean the same as the location path /descendant: :p ara. The latter selects the first descendant para element; the former selects all descendant para elements that are the first para children of their parents.