<xsl:template match="/*/*"> <Row> <xsl:apply-templates/> </Row> </xsl:template> <xsl:template match="/*/*/*"> <Cell> <xsl:choose> <xsl:when test="//xs:element[ @name = local-name(current()) ]/@type = 'xs:decimal'"> <Data ss:Type="Number"> <xsl:value-of select="."/> </Data> </xsl:when> <xsl:when test="//xs:element[ @name = local-name(current()) ]/@type = 'xs:string'"> <Data ss:Type="String"> <xsl:value-of select="."/> </Data> </xsl:when> <xsl:when test="//xs:element[ @name = local-name(current()) ]/@type = 'xs:dateTime'"> <Data ss:Type="String"> <xsl:value-of select="."/> </Data> </xsl:when> <xsl:when test="//xs:element[ @name = local-name(current()) ]/@type = 'xs:int'"> <Data ss:Type="Number"> <xsl:value-of select="."/> </Data> </xsl:when> <xsl:otherwise> <Data ss:Type="String"> <xsl:value-of select="."/> </Data> </xsl:otherwise> </xsl:choose> </Cell> </xsl:template>