I cannot wrap <panel>
tags to second level individual items as shown in Expected result bellow. Instead I get all 1.x element values into a single node with the xslt i have written bellow. Please help me.
Source xml
<root>
<step id="1">
<content>
<text>
1.0 Sample first level step text
</text>
</content>
<content/>
<step>
<content>
<text>
1.1 Sample second level step text
</text>
</content>
</step>
<step>
<content>
<text>
1.2 Sample second level step text
</text>
</content>
</step>
<step>
<content>
<text>
1.3 Sample second level step text
</text>
</content>
</step>
</step>
<step id="2">
<content>
<text>
2.0 Sample first level step text
</text>
</content>
<content/>
<step>
<content>
<text>
2.1 Sample second level step text
</text>
</content>
</step>
<step>
<content>
<text>
2.2 Sample second level step text
</text>
</content>
</step>
<step>
<content>
<text>
2.3 Sample second level step text
</text>
</content>
</step>
</step>
</root>
Expected output
<panel>
<panel>
<panel>
1.0 Sample first level step text
</panel>
<panel>
1.1 Sample second level step text
</panel>
<panel>
1.2 Sample second level step text
</panel>
<panel>
1.3 Sample second level step text
</panel>
</panel>
<panel>
<panel>
2.0 Sample first level step text
</panel>
<panel>
2.1 Sample second level step text
</panel>
<panel>
2.2 Sample second level step text
</panel>
<panel>
2.3 Sample second level step text
</panel>
</panel>
</panel>
My XSLT
<xsl:template match="/">
<panel>
<xsl:apply-templates/>
</panel>
</xsl:template>
<xsl:template match="root/step" >
<panel>
<panel>
<xsl:apply-templates select ="content/text/node()"></xsl:apply-templates>
</panel>
<panel>
<xsl:apply-templates select ="step/content/text/node()"></xsl:apply-templates>
</panel>
</panel>
</xsl:template>