<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" version="1.0">
	<xsl:output method="xml" indent="yes" encoding="utf-8"/>

	<xsl:template match="/">
		<xsl:choose>
		  <xsl:when test="facilitor">
  				<xsl:copy-of select="./node()"/> 
			</xsl:when>
			<xsl:otherwise>
		<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
			<soap:Body>
				<xsl:for-each select="//deel">
					<xsl:element name="deel">
						<xsl:attribute name="type">
							<xsl:value-of select="@type"/>
						</xsl:attribute>
						<xsl:element name="omschrijving">
							<xsl:value-of select="omschrijving"/>
						</xsl:element>
						<xsl:element name="waarde">
							<xsl:choose>
								<xsl:when test="waarde='AAN' or waarde='Aan' or waarde='aan'">1</xsl:when>
								<xsl:otherwise>0</xsl:otherwise>
							</xsl:choose>-<xsl:value-of select="count(//deel)"/>
						</xsl:element>
					</xsl:element>
				</xsl:for-each>
			</soap:Body>
		</soap:Envelope>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>