You can chooose which elements you want under your parent node by naming them explicitly. This will place only DocumentReference
under Kiran
.
<xsl:copy>
<Kiran>
<xsl:apply-templates select="@*|DocumentReference"/>
</Kiran>
<xsl:apply-templates select="@*|Item|Quantity"/>
</xsl:copy>
This is a quick and simple solution, but if you something more generic you can also achieve the same result by other means (ex: using xsl:if
, xsl:choose
or additional templates) writing a bit more code.