<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes" indent="yes" />
  <xsl:template match="DATAPACKET">
		<mlxmldata application="XSLT-Transformed TDataSet-XML" version="1">
			<xsl:apply-templates />
		</mlxmldata>
	</xsl:template>
	
	<xsl:template match="ROWDATA">
    <xsl:element name="crm_address">
		  <xsl:attribute name="count"><xsl:value-of select="count(ROW)" /></xsl:attribute>
		  <xsl:attribute name="updatecheck"><xsl:text>1</xsl:text></xsl:attribute>	
			<xsl:attribute name="modifyexisting"><xsl:text>1</xsl:text></xsl:attribute>			
		
			<xsl:apply-templates />
		</xsl:element>
  </xsl:template>
	
	<xsl:template match="ROW">
		<xsl:element name="crm_address_item">	  
		  <xsl:attribute name="companyname"><xsl:value-of select="@firma" /></xsl:attribute>
		  <xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
			<xsl:attribute name="surname"><xsl:value-of select="@vorname" /></xsl:attribute>
			<xsl:attribute name="adress"><xsl:value-of select="@adresse" /></xsl:attribute>
			<xsl:attribute name="zip"><xsl:value-of select="@plz" /></xsl:attribute>
			<xsl:attribute name="city"><xsl:value-of select="@ort" /></xsl:attribute>			
			<xsl:attribute name="countryid"><xsl:value-of select="@land" /></xsl:attribute>			
			<xsl:attribute name="birthday"><xsl:value-of select="@geburtstag" /></xsl:attribute>
			<xsl:attribute name="phone1"><xsl:value-of select="@telefon" /></xsl:attribute>
			<xsl:attribute name="email1"><xsl:value-of select="@email" /></xsl:attribute>
			<xsl:attribute name="internet1"><xsl:value-of select="@url" /></xsl:attribute>
			
			<xsl:attribute name="crm_address_groups"><xsl:value-of select="@zuordnung" /></xsl:attribute>
			<xsl:attribute name="crm_journal_note"><xsl:value-of select="@notiz" /></xsl:attribute>			
			
			<xsl:attribute name="crm_address_source"><xsl:text>Demo Import</xsl:text></xsl:attribute>
			<xsl:attribute name="crm_address_ident"><xsl:value-of select="@adressnr" /></xsl:attribute>			
			
		</xsl:element>
	</xsl:template>	
</xsl:stylesheet> 