I have the following the first lines of an XML file I want to remove Id node with its children nodes inside InitgPty only.
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>0001</MsgId>
<CreDtTm>2017-10-27T07:00:53</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>84562.00</CtrlSum>
<InitgPty>
<Nm>ABC Co</Nm>
<Id>
<OrgId />
</Id>
</InitgPty>
</GrpHdr>
After reading a lot I tried this XSLT but with no luck:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.six-interbank-clearing.com/de/pain.001.001.03.ch.02.xsd"
xsi:schemaLocation="http://www.six-interbank-clearing.com/de/pain.001.001.03.ch.02.xsd pain.001.001.03.ch.02.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" version="1.0" encoding="UTF-8" standalone="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*">
<xsl:element name="{name()}" >
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="/*">
<Document xsi:schemaLocation="http://www.six-interbank-clearing.com/de/pain.001.001.03.ch.02.xsd pain.001.001.03.ch.02.xsd">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</Document >
</xsl:template>
<xsl:template match="InitgPty/Id"/>
</xsl:stylesheet>
I added the below line :
<xsl:template match="InitgPty/Id"/>
I need your help to achieve the result.