Thanks hgen_banks
Here is the XML and XSL that I was able to use
<?xml version="1.0"?>
<D>
<D1 ID="1" NAME="NEERAJ" SCORE="8"/>
<D2 ID="2" NAME="RAJAT" SCORE="4"/>
<D3 ID="3" NAME="VINAY" SCORE="9"/>
</D>
and XSL to convert to CSV
<xsl
tylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl
utput method="text"/>
<xsl:template match="D">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="node()">
<xsl:for-each select="@*">
<xsl:text>"</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl
tylesheet>
Output:
"1","NEERAJ","8"
"2","RAJAT","4"
"3","VINAY","9"
Output