I need to transform the following xml :
You need to declare the namespace in your stylesheet, assign it a prefix, and use the prefix when addressing the document nodes - for example (including some streamlining):
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pain="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03"
exclude-result-prefixes="pain">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<root>
<xsl:for-each select="pain:Document/pain:CstmrPmtStsRpt/pain:GrpHdr">
<tblGrpHdr1>
<HeaderID>
<xsl:value-of select="position()"/>
</HeaderID>
<MsgId>
<xsl:value-of select="pain:MsgId"/>
</MsgId>
<CreDtTm>
<xsl:value-of select="pain:CreDtTm"/>
</CreDtTm>
<BICorBEI>
<xsl:value-of select="pain:InitgPty/pain:Id/pain:OrgId/pain:BICorBEI"/>
</BICorBEI>
</tblGrpHdr1>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>