<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="text"/>

	<xsl:variable name="new_line" select="'&#xA;'"/>

	<xsl:template match="/">
		<xsl:if test="PurchaseOrder/PO/orderitems/artikel">receiver;receiverName;customer;customerName;orderdatum;bestelnr;nummer;questornummer;questoromschrijving;inkoopprijs;aantal;prijs_per_verpakking;aantal_per_verpakking;btwperc;uom<xsl:value-of select="$new_line"/></xsl:if>
		<xsl:for-each select="PurchaseOrder/PO/orderitems/artikel">
			<xsl:value-of select="//PurchaseOrder/orderenvelop/receiver"/>;<xsl:value-of select="//PurchaseOrder/orderenvelop/receiverName"/>;<xsl:value-of select="//PurchaseOrder/PO/orderheader/customer"/>;<xsl:value-of select="//PurchaseOrder/PO/orderheader/customerName"/>;<xsl:value-of select="//PurchaseOrder/PO/orderheader/orderdatum"/>;<xsl:value-of select="//PurchaseOrder/PO/orderheader/bestelnr"/>;<xsl:value-of select="nummer"/>;<xsl:value-of select="questornummer"/>;<xsl:value-of select="questoromschrijving"/>;<xsl:value-of select="inkoopprijs"/>;<xsl:value-of select="aantal"/>;<xsl:value-of select="prijs_per_verpakking"/>;<xsl:value-of select="aantal_per_verpakking"/>;<xsl:value-of select="btwperc"/>;<xsl:value-of select="uom"/><xsl:value-of select="$new_line"/>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>
