I could not find a good template which fited my need on google when I wrote that, since all examples is for conversion from xmlss to xml , not the other way around, I learned some of the syntax to write my own, you can take a look at mine
String xslString = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ "<xsl:stylesheet version=\"1.0\" xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\">"
+ "<xsl:template match=\"/\"><xsl:processing-instruction name=\"mso-application\">progid=\"Excel.Sheet\"</xsl:processing-instruction><Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\"><xsl:for-each select=\"root\"><xsl:apply-templates/></xsl:for-each></Workbook></xsl:template><xsl:template match=\"root/*\">"
+ "<Worksheet><xsl:attribute name=\"ss:Name\"><xsl:value-of select=\"local-name()\"/></xsl:attribute><Table x:FullColumns=\"1\" x:FullRows=\"1\"><Row><xsl:for-each select=\"*[position() = 2]/*\"><Cell><Data ss:Type=\"String\"><xsl:value-of select=\"local-name()\"/></Data></Cell></xsl:for-each></Row><xsl:for-each select=\"./*\"><Row><xsl:for-each select=\"*\"><Cell><Data ss:Type=\"String\"><xsl:value-of select=\".\"/></Data></Cell></xsl:for-each></Row></xsl:for-each>"
+ "</Table></Worksheet></xsl:template></xsl:stylesheet>";
some of the words in the template are my nodes names in XML,
-------XML source-----------
<?xml version="1.0" encoding="UTF-8"?><root>
<Atlas1>
<row>
<Subject/>
<Title>titleA</Title>
<ContentType>contentA</ContentType>
</row>
<row>
<Subject>subjectB</Subject>
<Title>titleB</Title>
<ContentType>contentB</ContentType>
</row>
<row>
<Subject>subjectC</Subject>
<Title>titleC</Title>
<ContentType>contentC</ContentType>
</row>
</Atlas1>
<Atlas2>
<row>
<Subject/>
<Title>titleA</Title>
<ContentType>contentA</ContentType>
</row>
<row>
<Subject>subjectB</Subject>
<Title>titleB</Title>
<ContentType>contentB</ContentType>
</row>
<row>
<Subject>subjectC</Subject>
<Title>titleC</Title>
<ContentType>contentC</ContentType>
</row>
</Atlas2>
<Atlas3>
<row>
<Subject/>
<Title>titleA</Title>
<ContentType>contentA</ContentType>
</row>
<row>
<Subject>subjectB</Subject>
<Title>titleB</Title>
<ContentType>contentB</ContentType>
</row>
<row>
<Subject>subjectC</Subject>
<Title>titleC</Title>
<ContentType>contentC</ContentType>
</row>
</Atlas3>
</root>