how to concatenate multiples nodes using xpath

xml, xml-parsing, xpath-2.0

Solution

Yes, this is possible:

string-join(/SystemRoot/SystemRoot/concat(@SystemName, ".", @SystemDomain),
            ",")

Problem

I'm looking a way to get the following string using Xpath 2.0 only: AAA-Site-1.test.com,BBB-Site-1.test.com ``` <SystemRoot SystemName='Xpath Test'> <SystemRoot SystemDomain='test.com' SystemName='AAA-Site-1'> <Product InstallDate='11/01/2012' ProductName='AAA'/> </SystemRoot> <SystemRoot SystemDomain='test.com' SystemName='BBB-Site-1'> <Product InstallDate='11/01/2012' ProductName='BBB'/> </SystemRoot> </SystemRoot> ``` I tried concat and then string-join, but I get "too many values" ... ``` concat(/SystemRoot/SystemRoot/@SystemDomain,'.',/SystemRoot/SystemRoot/@SystemName) ``` Is it possible to achieve by using XPath 2.0 only ?

Original source