<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">

	<xsl:output omit-xml-declaration="yes" method="xml" indent="yes" />
	
	<xsl:template match="saml:Attribute">
		<xsl:choose>
			<xsl:when test="current()/@AttributeName='USER_FIRSTNAME'">
				<xsl:element name="saml:Attribute">
					<xsl:attribute name="AttributeName">First</xsl:attribute>
					<xsl:attribute name="AttributeNamespace">wf1</xsl:attribute>
					<xsl:element name="saml:AttributeValue"><xsl:value-of select="current()"/></xsl:element>					
				</xsl:element>
			</xsl:when>
			<xsl:when test="current()/@AttributeName='USER_LASTNAME'">
				<xsl:element name="saml:Attribute">
					<xsl:attribute name="AttributeName">Last</xsl:attribute>
					<xsl:attribute name="AttributeNamespace">wf1</xsl:attribute>
					<xsl:element name="saml:AttributeValue"><xsl:value-of select="current()"/></xsl:element>					
				</xsl:element>
			</xsl:when>
			<xsl:when test="current()/@AttributeName='USER_ID'">
				<xsl:element name="saml:Attribute">
					<xsl:attribute name="AttributeName">ExternalUserId</xsl:attribute>
					<xsl:attribute name="AttributeNamespace">wf1</xsl:attribute>
					<xsl:element name="saml:AttributeValue"><xsl:value-of select="current()"/></xsl:element>					
				</xsl:element>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template match="saml:AttributeStatement">
		<xsl:element name="saml:AttributeStatement">
			<xsl:apply-templates select="node()|@*"/>
			<xsl:element name="saml:Attribute"><xsl:attribute name="AttributeName">Template</xsl:attribute><xsl:attribute name="AttributeNamespace">wf1</xsl:attribute>
				<xsl:element name="saml:AttributeValue">testtemplate</xsl:element>					
			</xsl:element>
		</xsl:element>
	</xsl:template>

	<xsl:template match="node()|@*">
		<xsl:copy>
			<xsl:apply-templates select="node()|@*"/>
		</xsl:copy>
	</xsl:template>
</xsl:transform>