<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>However, while this works for decimal, datetime and integer types, this does not work for string type. I have found that the condition for string type is never executed. The only way I can print my string field is by having an Otherwise clause later down the Xsl stylesheet.