Here is the sample xml document.
count the number of words
For this example I want
Here's an XSLT I was just building based on the answer by Dimitre Novatchev above. It's counting words under root/data/value (this is for .NET resource files [.RESX]), but you can easily adapt it.
Regarding the node-set function it uses, see the URL mentioned in the XSLT on how to do it with EXSLT enabled processors or others that support this function natively (the use of the msxml namespace is for .NET/MSXML, can easily change that to refer to EXSLT etc.)