<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/" >
		<DES>
			<Properties>

				<FormatVersion> 
					<xsl:value-of select="/EventGraph/FormatVersion">
					</xsl:value-of>
				</FormatVersion>
			
				<DESName>
					<xsl:value-of select="/EventGraph/Properties/EGName">
					</xsl:value-of>
				</DESName>
			
				<Version>
					<xsl:value-of select="/EventGraph/Properties/Version">
					</xsl:value-of>
				</Version>
			
				<Author>
					<xsl:value-of select="/EventGraph/Properties/Author">
					</xsl:value-of>
				</Author>
			
				<Company>
					<xsl:value-of select="/EventGraph/Properties/Company">
					</xsl:value-of>			
				</Company>
			
				<Copyright>
					<xsl:value-of select="/EventGraph/Properties/Copyright">
					</xsl:value-of>
				</Copyright>
			
				<Description>
					<xsl:value-of select="/EventGraph/Properties/Description">
					</xsl:value-of>
				</Description>

			</Properties>
			
			<xsl:apply-templates select="/EventGraph/Event" >
			</xsl:apply-templates>
			
			<xsl:apply-templates select="/EventGraph/SelfEdge" >
			</xsl:apply-templates>
			<xsl:apply-templates select="/EventGraph/SourceToTargetEdge" >
			</xsl:apply-templates>
			<xsl:apply-templates select="/EventGraph/CancellingEdge" >
			</xsl:apply-templates>

		</DES>
</xsl:template>

<xsl:template match="Event" >

	<Event>

		<Identification>
			<xsl:attribute name="id">
				<xsl:value-of select="Identification/@id">
				</xsl:value-of>
			</xsl:attribute> 
		</Identification>
	
		<Name>
			<xsl:value-of select="Name/@name">
			</xsl:value-of>
		</Name>
	
		<xsl:for-each select="OutgoingEdge">
			<OutgoingEdge>
				<xsl:attribute name="id">
					<xsl:value-of select="@id">
					</xsl:value-of>
				</xsl:attribute> 
			</OutgoingEdge>
		</xsl:for-each>
	
	</Event>
	
</xsl:template>

<xsl:template match="SelfEdge" >

	<SelfEdge>

		<Identification>
			<xsl:attribute name="id">
				<xsl:value-of select="Identification/@id">
				</xsl:value-of>
			</xsl:attribute> 
		</Identification>
		
		<TargetEvent >
			<xsl:attribute name="id">
				<xsl:value-of select="TargetEvent /@id">
				</xsl:value-of>
			</xsl:attribute> 
		</TargetEvent >
		
	</SelfEdge>
	
</xsl:template>


<xsl:template match="SourceToTargetEdge" >

	<SourceToTargetEdge>

		<Identification>
			<xsl:attribute name="id">
				<xsl:value-of select="Identification/@id">
				</xsl:value-of>
			</xsl:attribute> 
		</Identification>
		
		<TargetEvent >
			<xsl:attribute name="id">
				<xsl:value-of select="TargetEvent /@id">
				</xsl:value-of>
			</xsl:attribute> 
		</TargetEvent >
		
	</SourceToTargetEdge>
	
</xsl:template>

<xsl:template match="CancellingEdge" >

	<CancellingEdge>

		<Identification>
			<xsl:attribute name="id">
				<xsl:value-of select="Identification/@id">
				</xsl:value-of>
			</xsl:attribute> 
		</Identification>
		
		<TargetEvent >
			<xsl:attribute name="id">
				<xsl:value-of select="TargetEvent /@id">
				</xsl:value-of>
			</xsl:attribute> 
		</TargetEvent >
		
	</CancellingEdge>
	
</xsl:template>

</xsl:stylesheet>

