The following is the sample XML structure I'm working on:

<command name="test">
<parameter index="2">4000</parameter>
<parameter index="1">ports</parameter>
<parameter index="2">1:1,</parameter>
<parameter index="3">3:1,</parameter>
<parameter index="4">3:9-12</parameter>
<parameter index="5">4:12</parameter>
<parameter index="3">add</parameter>
<parameter index="4">ports</parameter>
<parameter index="5">1:1,</parameter>
<parameter index="6">3:1,</parameter>
<parameter index="7">3:9-12,</parameter>
<parameter index="8">4:12</parameter>
<tagged />
<parameter index="9">tagged</parameter>

And my key statement in the XSL file is:

<xsl:key name="port" match="command[@name='test'][count(add) &gt; 0]" use="add/parameter"/>

I need to change the 'use' expression in the key so that the values are changed from '1:1,' to '1:1' and similarly '3:1,' to '3:1' and expand '3:9-12,' to '3:9' , '3:10' , '3:11' , '3:12' and store all of them in the same key.

Is this possible? I'm working on this for a week and still not able to find a solution. Any help would be really appreciated. Thanks a lot guys.