Hi,
Hope you are doing well.
I came up with the requirement where I need to format the source CREATION_DATE to tns:recordStamp "2021-04-09T22:52:02" format in XSLT. Also I am checking If creation date is not coming from source then tns:recordStamp element should not be in target XML Payload.
XSLT :
<xsl:if test="/ns0:OutputParameters/ns0:P_PAYLOAD_CUST_SEND_TBL/ns0:P_PAYLOAD_CUST_SEND_TBL_ITEM/ns0:CREATION_DATE !=''">
<tns:recordStamp>
<xsl:value-of select="xp20:format-dateTime (/ns0:OutputParameters/ns0:P_PAYLOAD_CUST_SEND_TBL/ns0:P_PAYLOAD_CUST_SEND_TBL_ITEM/ns0:CREATION_DATE, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]' )"/>
</tns:recordStamp>
</xsl:if>
Cheers!!