i am trying to convert xml to csv using XSLT. i am able to pull data to csv but not all child nodes. From root only 2 level child node are populating in csv. anything below level 3 child node are clubbed into one and populating in csv. i dont want to mention any elements names in xslt, as xml will be keep changing.
XML used
xml <Tx>
<New>
<Id>123456</Id>
<Submitted>true</Submitted>
<Buyer>
<AcctOwnr>
<Id>
<Gender>Male</Gender>
</Id>
<City>GB</City>
</AcctOwnr>
</Buyer>
<Seller>
<AcctOwnr>
<Id>
<Gender>Female</Gender>
</Id>
<City>GB</City>
</AcctOwnr>
</Seller>
<Order>
<TrnsmssnInd>false</TrnsmssnInd>
</Order>
<Tx>
<Date>2019-05-08</Date>
<cty>DEAL</cty>
<Qty>
<Value Ccy="USD">5000</Value>
</Qty>
<Price>
<Price>
<Value>
<Amt Ccy="USD">95.1</Amt>
</Value>
</Price>
</Price>
<TradVn>XOFF</TradVn>
<CtryOfBrnch>GB</CtryOfBrnch>
</Tx>
<AddtlAttrbts>
<TxInd>false</TxInd>
</AddtlAttrbts>
</New></Tx>
XSLT
enter code here<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/*">
<xsl:for-each select="*[1]/*">
<xsl:value-of select="name()"/>
<xsl:if test="position() != last()">, </xsl:if>
<xsl:if test="position() = last()">
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:template>
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:param name="fieldNames" select="'yes'" />
<xsl:strip-space elements="*" />
<xsl:template match="/*/child::*">
<xsl:for-each select="child::*">
<xsl:if test="position() != last()">
<xsl:value-of select="normalize-space(.)"/>, </xsl:if>
<xsl:if test="position() = last()">
<xsl:value-of select="normalize-space (.)"/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>`
results what i got from above is
expected results is


<Tx>, ends with</New>.