<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output indent="yes" />

<!--mantengo las variables globales-->
   <xsl:variable name="orientationpt" select="'PtoT'" />

   <xsl:variable name="orientationtp" select="'TtoP'" />

   <xsl:variable name="x" select="0" />

   <xsl:variable name="y" select="1" />

   <xsl:template match="/">
      <workspaceElements>
         <generator tool="CPN Tools" version="2.9.12" format="6" />

<cpnet>
<xsl:for-each select="//declaration">
	<xsl:copy-of select="."/>
</xsl:for-each>	
<page id="ID6">

<pageattr name="Petri's Net"/>



 
 
   
 <!--LOCATIONS-->
 <xsl:call-template name="place"></xsl:call-template>
   <xsl:call-template name="trans"></xsl:call-template>    
 <!--TRANSICIONES-->
 <xsl:call-template name="arc"></xsl:call-template>   
       

  

 
</page> 
<xsl:for-each select="//fin">
	<xsl:copy-of select="."/>
</xsl:for-each>	


</cpnet>
</workspaceElements>
</xsl:template>

<!--Definición de las variables-->


<!--place de cada una de las plantillas-->
<xsl:template name="place">	
<xsl:for-each select="descendant::place">
	<xsl:call-template name="aux1"/>
	</xsl:for-each>
</xsl:template>
 <xsl:template name="trans">
  <!--para las transiciones-->
  <xsl:for-each select="//trans">
 	<xsl:call-template name="aux2"/>
 
</xsl:for-each> 
</xsl:template>


<!--Transitions de cada una de las plantillas-->
<xsl:template name="arc">

 <xsl:for-each select="//arc"> 
 	
 	<xsl:call-template name="aux4"/>
  </xsl:for-each>			

	
</xsl:template>




<xsl:template name="inarc">
	
							<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
					        <posattr x="0.000000"
					                 y="0.000000"/>
					        <fillattr colour="White"
					                  pattern=""
					                  filled="false"/>
					        <lineattr colour="Black"
					                  thick="1"
					                  type="Solid"/>
					        <textattr colour="Black"
					                  bold="false"/>
					        <arrowattr headsize="1.200000"
					                   currentcyckle="2"/>
					                   
		

</xsl:template>

<xsl:template name="endarc">
								<posattr x="-25.000000"
					                   y="50.000000"/>
					          <fillattr colour="White"
					                    pattern="Solid"
					                    filled="false"/>
					          <lineattr colour="Black"
					                    thick="0"
					                    type="Solid"/>
					          <textattr colour="Black"
					                    bold="false"/>

</xsl:template>

<xsl:template name="inplace">

 <posattr x="-107.000000"
                 y="-99.000000"/>
        <fillattr colour="White"
                  pattern=""
                  filled="false"/>
        <lineattr colour="Black"
                  thick="1"
                  type="Solid"/>
        <textattr colour="Black"
                  bold="false"/>
</xsl:template>

<xsl:template name="mplace">
	
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
</xsl:template>
<xsl:template name="endplace">
		  <posattr x="-395.500000"
                   y="-2.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>

</xsl:template>

<xsl:template name="eplace">
		<ellipse w="60.000000" h="40.000000"/>
		<token x="-10.000000" y="0.000000"/>
		<marking x="0.000000" y="0.000000" hidden="false"/>
</xsl:template>


<xsl:template name="intrans">
		<posattr x="-199.000000"
                 y="141.000000"/>
        <fillattr colour="White"
                  pattern=""
                  filled="false"/>
        <lineattr colour="Black"
                  thick="1"
                  type="solid"/>
        <textattr colour="Black"
                  bold="false"/>
</xsl:template>
<xsl:template name="condtrans">
	<posattr x="-254.000000"
                   y="172.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
</xsl:template>

<xsl:template name="timetrans">
	<posattr x="-120.500000"
                   y="175.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
</xsl:template>

<xsl:template name="codetrans">
	<posattr x="-134.500000"
                   y="89.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
</xsl:template>

<xsl:template name="channeltrans">
	<posattr x="-262.500000"
                   y="141.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
                    
                    
</xsl:template>
<xsl:template name="prioritytrans">
	<posattr x="-270.000000"
                   y="100.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
</xsl:template>

<!--Plantilla para la transición de repetición de los WORKUNIT-->		



<!--Plantilla para la transición de repetición de los WORKUNIT acabados con un FAIL-->		



<xsl:template name="replace-place">
	 <place>
 		
 			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>  		
  			
	  		<xsl:for-each select="inplace">	 	
	 			<xsl:call-template name="inplace"/>
	 		</xsl:for-each>
	 			<xsl:copy-of select="text"/>
	 			
	 		<xsl:for-each select="eplace">
	 			<xsl:call-template name="eplace"/>
	 		</xsl:for-each>	
	 		<type>
	 			<xsl:attribute name="id"><xsl:value-of select="type/@id"/></xsl:attribute>
	 			<posattr x="-45.000000" y="-122.000000"/>
	 			
	 		<xsl:for-each select="type/mplace">
	 			<xsl:call-template name="mplace"/>
	 		</xsl:for-each>
	 		<xsl:copy-of select="type/text"/>
			</type>
			<initmark>
			<xsl:attribute name="id"><xsl:value-of select="initmark/@id"/></xsl:attribute>  		
	  		<xsl:for-each select="initmark/endplace">
	  			<xsl:call-template name="endplace"/>
	  		</xsl:for-each>
	  		<xsl:copy-of select="initmark/text"/>
	  		</initmark>
	  		
		</place>

</xsl:template>



<xsl:template name="replace-arc">
	<arc>
	<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>  	
	<xsl:attribute name="orientation"><xsl:value-of select="@orientation"/></xsl:attribute>  
	<xsl:for-each select="inarc">
		<xsl:call-template name="inarc"/>
	</xsl:for-each>	
	
	<xsl:if test="contains(@orientation,'PtoT')">

		<xsl:copy-of select="placeend"/>
		<xsl:copy-of select="transend"/>
	</xsl:if>
	<xsl:if test="contains(@orientation,'TtoP')">

		<xsl:copy-of select="transend"/>
		<xsl:copy-of select="placeend"/>
	</xsl:if>
	<annot>
		<xsl:attribute name="id"><xsl:value-of select="annot/@id"/></xsl:attribute>
	<xsl:for-each select="annot/endarc">
		<xsl:call-template name="endarc"/>
	</xsl:for-each>
	<xsl:copy-of select="annot/text"/>
	</annot>
	</arc>

</xsl:template>

<xsl:template name="replace-trans">
	<trans>
  		<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>  
  		<xsl:call-template name="intrans"/>
  		<xsl:copy-of select="text"/>
  		<xsl:copy-of select="box"/>
  		<xsl:copy-of select="binding"/>
  		<cond>
  		<xsl:attribute name="id"><xsl:value-of select="cond/@id"/></xsl:attribute>
  		<xsl:call-template name="condtrans"/>
  		<xsl:copy-of select="cond/text"/>
  		</cond>
  		<time>
  		<xsl:attribute name="id"><xsl:value-of select="time/@id"/></xsl:attribute>  
  		<xsl:call-template name="timetrans"/>
  		<xsl:copy-of select="time/text"/>
  		</time>
  		<code>
  		<xsl:attribute name="id"><xsl:value-of select="code/@id"/></xsl:attribute>  
  		<xsl:call-template name="codetrans"/>
  		<xsl:copy-of select="code/text"/>
  		</code>
  		<channel>
  		<xsl:attribute name="id"><xsl:value-of select="channel/@id"/></xsl:attribute>  
  		<xsl:call-template name="channeltrans"/>
  		<xsl:copy-of select="channel/text"/>
  		</channel>
  		<priority>
  		<xsl:attribute name="id"><xsl:value-of select="priority/@id"/></xsl:attribute>  
  		<xsl:call-template name="prioritytrans"/>
  		<xsl:copy-of select="priority/text"/>
  		</priority>
  		</trans>


</xsl:template>

<xsl:template name="aux1">
<xsl:if test="starts-with(@id,'idEnd_Interaction') and (name(parent::*[1]) = 'SEQUENCE') and((following::*[2]/@id='0') or starts-with(following::*[2]/@id,'idEnd_Choice') ) and count(following-sibling::*)=0 and not(ancestor::PARALLEL)">
 		
 		<!--creo un arco de End->Choice-end-->
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranshijo-endpadre',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      			<xsl:value-of select="preceding-sibling::*[12]/@id"/>
		      	</xsl:attribute>
		      	</xsl:element>   
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="'idEnd_Choice'"/><xsl:value-of select="count(preceding::CHOICE)"/>
		        	</xsl:attribute>
		        </xsl:element>  
		           
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworktranshijoannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
 	</xsl:if>
 	
 	<xsl:if test="starts-with(@id,'idEnd_Choice') and starts-with(following::*[1]/@id,'idEnd_Workunitt')">
 	<!--creo arco de endchoice->endworkunit-->
 		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcendendwork',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>	
		        </xsl:element>  
		           <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      			<xsl:value-of select="following::*[1]/@id"/>
		      	</xsl:attribute>
		      	</xsl:element>   
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendendworkannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
 	</xsl:if>
	<xsl:if test="starts-with(@id,'idEnd_Choice')">
	<xsl:variable name="place" select="@id"/>
		<xsl:for-each select="//descendant::*[name()='CHOICE']/descendant::*[name()='trans']">
			<xsl:if test="starts-with(@id,'idtransintcopy')">
				<!--creo arco de vuelta a la repeticion del workunit-->
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranshijorepe-endpadre',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="$place"/>
		        </xsl:attribute>	
		        </xsl:element>  
		           <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      			<xsl:value-of select="@id"/>
		      	</xsl:attribute>
		      	</xsl:element>   
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctranshijorepe-endpadreannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idInit_Workunit')">
	<xsl:variable name="aux3" select="@id"/>
	<xsl:for-each select="//descendant::*[name()='WORKUNIT']/descendant::*[name()='CHOICE']/descendant::*[name()='SEQUENCE']/descendant::*[name()='trans']">
  	
  	<xsl:if test="starts-with(@id,'idtransint') and not(starts-with(@id,'idtransintcopy')) and count(preceding-sibling::*)=1">
  	<!--arco de pin->trans-->
  			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworktransinthijo',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		        <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		        		<xsl:value-of select="$aux3"/></xsl:attribute>
		        </xsl:element>  
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      			<xsl:value-of select="@id"/></xsl:attribute>
		      	
		        </xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworktransinthijoannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		      </xsl:if>
		      
		      	<xsl:if test="starts-with(@id,'idfailint1') and not(starts-with(@id,'idfail1int2')) and count(preceding-sibling::*)=44">
		      	
  				<!--arco de pin->fail1-->
  		   <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworkfailhijo',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		        <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		        		<xsl:value-of select="$aux3"/></xsl:attribute>
		        </xsl:element>  
		      		<xsl:element name="transend">
		      		<xsl:attribute name="idref">
		      			<xsl:value-of select="@id"/></xsl:attribute>
		      			
		        </xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworkfailhijoannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		      </xsl:if>
		      <xsl:if test="starts-with(@id,'idtimeout') and not(starts-with(@id,'idtimeoutcopy')) and count(preceding-sibling::*)=44">
  				<!--arco de pin->timeout-->
  			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworktimeouthijo',generate-id())"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		        <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		        		<xsl:value-of select="$aux3"/></xsl:attribute>
		        </xsl:element>  
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      			<xsl:value-of select="@id"/>
		      	</xsl:attribute>	
		        </xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinworktimeouthijoannot',generate-id())"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		  </xsl:if>
		 
		
		<!--si no tengo idInit_Workunitt el inicial será idInit_workunit-->
	
	
  		</xsl:for-each>
	</xsl:if>
	
	 <xsl:if test="starts-with(@id,'idEnd_Assign') and starts-with(preceding-sibling::*[8]/@id,'idtrans_Assigncopy')">
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtranscopyy',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>	
		        </xsl:element>
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="preceding-sibling::*[8]/@id"/></xsl:attribute>
		      	</xsl:element>       
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtranscopyyannot',@id)"/></xsl:attribute>
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
	
		</xsl:if>
	<!--copiar los end que sean necesarios dentro del parallel-->
	<xsl:if test="starts-with(@id,'idEnd') and ancestor::PARALLEL  and not(starts-with(following-sibling::*[1]/@id,'idInit'))">
		<xsl:call-template name="replace-place"/>
	</xsl:if>
	<!--per_parallel-->
	<xsl:if test="starts-with(@id,'idper_Parallel')">
		<xsl:variable name="aux" select="@id"/>
		<xsl:for-each select="//trans">
			<xsl:if test="contains(@id,'fail')">	
		<!--creo un arco desde todos los fail->perpar-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcperparfail',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="$aux"/>
		        </xsl:attribute>	
		        </xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcperparfailannot',@id)"/></xsl:attribute>
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>	
	<!--pc_parallel-->
	<xsl:if test="starts-with(@id,'idpc_Parallel')">
		<xsl:variable name="aux" select="@id"/>
		<xsl:for-each select="//descendant::*[name()='PARALLEL']/descendant::*[name()='trans']">	
			<xsl:if test="not(contains(@id,'idInit_Parallell'))">
			<!--creo un arco de pc->trans-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpctrans',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="$aux"/>		
		        	</xsl:attribute>
		        </xsl:element>  
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpctransannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		     </xsl:if> 
		     
		</xsl:for-each>
		<xsl:for-each select="//descendant::*[name()='PARALLEL']/descendant::*[name()='trans']">
			<xsl:if test="not(contains(@id,'fail') and not(contains(@id,'idEnd_Parallel'))and not(contains(@id,'idInit_Parallell')))">
				<!--creo arco de trans->pc-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranspc',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="$aux"/>
		        </xsl:attribute>	
		        </xsl:element>      
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctranspcannot',@id)"/></xsl:attribute>
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idEnd_Assign') and starts-with(preceding-sibling::*[4]/@id,'idtrans_Assigncopy')">
			<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtranscopy',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				        
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref">
				      			<xsl:value-of select="@id"/>		
				       </xsl:attribute> 
				        </xsl:element> 
				        <xsl:element name="transend">
				      	<xsl:attribute name="idref">
								<xsl:value-of select="preceding-sibling::*[4]/@id"/>
				 		</xsl:attribute>
				      	</xsl:element>      
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtranscopyannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
		
		</xsl:if>
		<xsl:if test="ancestor::WORKUNIT and not(starts-with(@id,'idInit_Choice')) and (starts-with(@id,'idInit'))  and not(count(preceding-sibling::*)=0)">
			<xsl:call-template name="replace-place"/>
		</xsl:if>
 	<!--copio los place iniciales-->
 	<xsl:if test="starts-with(@id,'idInit') and not(starts-with(preceding::*[3]/@id,'idpin')) and not(ancestor::WORKUNIT) ">
 	<xsl:call-template name="replace-place"/>
 	
 		<xsl:variable name="place" select="@id"/>
 		<!--miro a ver si tienen como antecesor un end y creo un arco a donde end estaba unido-->
 		
 		<xsl:if test="starts-with(preceding-sibling::*[1]/@id,'idEnd') and starts-with(preceding-sibling::*[2],'idtrans')">
 		
 		
 					<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarctransanteriorpinnext',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				        <xsl:element name="transend">
				      	<xsl:attribute name="idref">
								<xsl:value-of select="preceding-sibling::*[2]/@id"/>
				 		</xsl:attribute>
				      	</xsl:element>
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref"> 
				      			<xsl:value-of select="$place"/>		
				      </xsl:attribute> 
				        </xsl:element>       
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctransanteriorpinnextannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
				     
 		</xsl:if>
 		
 		<!--si tengo un init lo uno con la actividad anterior que no son hermanos-->
 		<xsl:if test="starts-with(preceding::*[3]/@id,'idEnd')">
 			<xsl:variable name="trans" select="concat('idtransint',substring-after(preceding::*[3]/@id,'idEnd_Interactioninitmark'))"/>
 			<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarctransanteriorpin',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				        <xsl:element name="transend">
				      	<xsl:attribute name="idref">
							<xsl:value-of select="$trans"/>
				 		</xsl:attribute>
				      	</xsl:element>
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref"> 
				      			<xsl:value-of select="$place"/>		
				      </xsl:attribute> 
				        </xsl:element>       
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctransanteriorpinannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
 		</xsl:if>
 		<xsl:if test="starts-with(following::*[3]/@id,'idInit')">
 		<xsl:variable name="trans" select="concat('idtrans_Assign',substring-after(following::*[3]/@id,'idInit_Assign'))"/>
 					<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarcpintransnext',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				        
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref">
				      		<xsl:value-of select="$place"/>
				       		</xsl:attribute> 
				       </xsl:element>
				       <xsl:element name="transend">
				      	<xsl:attribute name="idref">
							<xsl:value-of select="$trans"/>
				      </xsl:attribute>	
				        </xsl:element>       
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpintransnextannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
 		</xsl:if>
 		
	 </xsl:if>
	 
	<!--miro los End y si como antecesor no tengo un Init lo copio-->
	<xsl:if test="(starts-with(@id,'idEnd') or starts-with(@id,'idpok') )and starts-with(following::*[1]/@id,'idEnd')">
		<xsl:call-template name="replace-place"/>
		<xsl:variable name="aux1" select="@id"/>
		
		<xsl:if test="starts-with(preceding-sibling::*[7]/@id,'idtrans_Assigncopy')">
		<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtransassing',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				       
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref">
				      		<xsl:value-of select="$aux1"/>	
				       </xsl:attribute> 
				        </xsl:element> 
				        <xsl:element name="transend">
				      	<xsl:attribute name="idref">
							<xsl:value-of select="preceding-sibling::*[7]/@id"/>
				 		</xsl:attribute>
				      	</xsl:element>      
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendtransassingannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
		</xsl:if>
		
		<!--si como padre tengo un workunit creo el arco de union entre ellos-->
		<xsl:if test="starts-with(following::*/@id,'idEnd_Workunitt') and (parent::*/parent::*/@id)-1=substring-after(following::*/@id,'idEnd_Workunitt')">
			<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarcendhijoendpadre',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				        
				      	<xsl:element name="placeend">
				        	<xsl:attribute name="idref">
				      	<xsl:value-of select="@id"/>	
				       	</xsl:attribute> 
				       	</xsl:element>   
				       <xsl:element name="transend">
				      	<xsl:attribute name="idref">	
							<xsl:value-of select="following::*/@id"/>
				 		</xsl:attribute>
				      	</xsl:element>
				            
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendhijoendpadreannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
		</xsl:if>
	</xsl:if>
	<!--copio los place que siempre necesito-->
	<xsl:if test="not(starts-with(@id,'idInit'))and(not(starts-with(@id,'idEnd'))) and(not(starts-with(@id,'idplaceg'))) and(not(starts-with(@id,'idplace1int'))) and(not(starts-with(@id,'idper'))) and (not(starts-with(@id,'idplace1_Assign')))">
		<xsl:call-template name="replace-place"/>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idper') and not(ancestor::PARALLEL) and not(ancestor::CHOICE)">
		<xsl:call-template name="replace-place"/>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idperchoice')">
	<xsl:variable name="aux1" select="@id"/>
		<xsl:for-each select="//descendant::*[name()='CHOICE']/descendant::*[name()='trans']">
			<xsl:if test="starts-with(@id,'idfail')">
			<!--creo un arco del fail->perchoice-->
			<xsl:element name="arc">
					<xsl:attribute name="id"><xsl:value-of select="concat('idarcfailperchoice',@id)"/></xsl:attribute>
					<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
					<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
				        <posattr x="0.000000"
				                 y="0.000000"/>
				        <fillattr colour="White"
				                  pattern=""
				                  filled="false"/>
				        <lineattr colour="Black"
				                  thick="1"
				                  type="Solid"/>
				        <textattr colour="Black"
				                  bold="false"/>
				        <arrowattr headsize="1.200000"
				                   currentcyckle="2"/>
				       <xsl:element name="transend">
				      	<xsl:attribute name="idref">	
							<xsl:value-of select="@id"/>
				 		</xsl:attribute>
				      	</xsl:element>
				         <xsl:element name="placeend">
				        	<xsl:attribute name="idref">
				      	<xsl:value-of select="$aux1"/>	
				       	</xsl:attribute> 
				       	</xsl:element>    
				        <xsl:element name="annot">
				        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcfailperchoiceannot',@id)"/></xsl:attribute>
				          <posattr x="-25.000000"
				                   y="50.000000"/>
				          <fillattr colour="White"
				                    pattern="Solid"
				                    filled="false"/>
				          <lineattr colour="Black"
				                    thick="0"
				                    type="Solid"/>
				          <textattr colour="Black"
				                    bold="false"/>
				          <text tool="CPN Tools"
				                version="2.2.0"><xsl:value-of select="$x"/></text>
				        </xsl:element> 
				      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
	<xsl:if test="contains(@id,'idplace1_Assign')">
		<xsl:variable name="placeaux" select="substring-before(text,'_assign')"/>
		<xsl:variable name="place" select="@id"/>
		
		<xsl:if test="not(//place[starts-with(@id,'idplace1int') and (substring-after('m',text)=$placeaux)])">
			
			
 			<place>
 			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> 		
	  		<xsl:for-each select="inplace">	 	
	 			<xsl:call-template name="inplace"/>
	 		</xsl:for-each>
	 			<xsl:copy-of select="text"/>
	 			
	 		<xsl:for-each select="eplace">
	 			<xsl:call-template name="eplace"/>
	 		</xsl:for-each>	
	 		<type>
	 			<xsl:attribute name="id"><xsl:value-of select="type/@id"/></xsl:attribute>
	 			<posattr x="-45.000000" y="-122.000000"/>
	 			
	 		<xsl:for-each select="type/mplace">
	 			<xsl:call-template name="mplace"/>
	 		</xsl:for-each>
	 		<xsl:copy-of select="type/text"/>
			</type>
			<initmark>
			<xsl:attribute name="id"><xsl:value-of select="initmark/@id"/></xsl:attribute>  		
	  		<xsl:for-each select="initmark/endplace">
	  			<xsl:call-template name="endplace"/>
	  		</xsl:for-each>
	  		<text tool="CPN Tools" version="2.2.0"><xsl:value-of select="initmark/text"/></text>
	  		</initmark>
	  		
		</place>
		
		</xsl:if>
		
	
		
			<xsl:for-each select="//place[starts-with(@id,'idplace1int') and (substring-after('m',text)=$placeaux)]">
				<xsl:variable name="aux1" select="@id"/>
				<xsl:for-each select="//arc">
				<xsl:if test="contains(placeend/@idref,$place) and contains(@orientation,'TtoP')">
				<!--arco place->transassign-->
				<xsl:element name="arc">
				<xsl:attribute name="id"><xsl:value-of select="concat('idarcassignplacetrans',$aux1)"/><xsl:value-of select="generate-id()"/></xsl:attribute>
				<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
				<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="transend/@idref"/>
		      	</xsl:attribute>	
		      	</xsl:element>   
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="$aux1"/>
		        	</xsl:attribute>
		        </xsl:element>  
		           
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcassignplacetransannot',$aux1)"/><xsl:value-of select="generate-id()"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="concat('m',annot/text)"/></text>
		        </xsl:element> 
		      </xsl:element>
		      </xsl:if>
		      <xsl:if test="contains(placeend/@idref,$place) and contains(@orientation,'PtoT')">
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcplacetransassign',$aux1)"/><xsl:value-of select="generate-id()"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		         
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">		
		      		<xsl:value-of select="$aux1"/>
		        </xsl:attribute>	
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="transend/@idref"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcplacetransassignannot',$aux1)"/><xsl:value-of select="generate-id()"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="annot/text"/></text>
		        </xsl:element> 
		      </xsl:element>
		      </xsl:if>
		    </xsl:for-each> 
		
		</xsl:for-each>	
			
 	
	</xsl:if>

</xsl:template>
<xsl:template name="aux2">
	 <!--copio las transidiones fijas-->
  		<xsl:if test="not(starts-with(@id,'idfailg'))">
  			<xsl:call-template name="replace-trans"/>
  		</xsl:if>
		<xsl:if test="starts-with(@id,'idEnd_Parallel') and starts-with(following::*[32]/@id,'idInit')">
		<!--cre un arco del parallel a el ini siguient-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcendparinitnex',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element>  
		      		 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">		
		      	<xsl:value-of select="following::*[32]/@id"/></xsl:attribute>
		        	
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcendparinitnextannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="0"/></text>
		        </xsl:element> 
		      </xsl:element>
		     
		</xsl:if>
		<xsl:if test="starts-with(@id,'idtrans_Assign') and starts-with(following-sibling::*[2]/@id,'idInit')">
		
	<!--creo arco de trans_Assign-al initsiguiente no tiene timeout-->
	<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctransassingpinnext',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element>  
		      		 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">		
		      	<xsl:value-of select="following-sibling::*[2]/@id"/></xsl:attribute>
		        	
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctransassingpinnextannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="0"/></text>
		        </xsl:element> 
		      </xsl:element>
		     
		     
	</xsl:if>
	

	<xsl:if test="starts-with(@id,'idtrans_Assigncopy') and starts-with(following-sibling::*[5]/@id,'idInit') ">
	
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranscopyinitnext',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="following-sibling::*[5]/@id"/>
		        </xsl:attribute>		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctranscopyinitnextannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="0"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:if>
	<xsl:if test="(starts-with(@id,'idfail1int2'))">
		<xsl:variable name="trans" select="@id"/>
		<xsl:variable name="auxg1" select="following-sibling::*[1]"/>
		<xsl:variable name="text" select="text"/>
		<xsl:for-each select="//arc[annot/text=$auxg1]">
			<xsl:if test="not(starts-with(placeend/@idref,'idplace2int'))">
			<!--creo arco de ida y vuelta con fail-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans30ref30',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans30ref30annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref30trans30',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref30trans30annot',placeend/@idref),$text)"/></xsl:attribute>
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idfailint1')">
		<xsl:variable name="trans" select="@id"/>
		<xsl:variable name="auxg1" select="following-sibling::*[1]"/>
		<xsl:variable name="text" select="text"/>
	
		<xsl:for-each select="//arc[annot/text=$auxg1]">
			
			<xsl:if test="not(starts-with(placeend/@idref,'idplace2int')) and not(starts-with(placeend/@idref,'idplace1int'))">
		
			<!--creo arco de ida y vuelta con fail-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans11ref11',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>	
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans11ref11annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref11trans11',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        			
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref11trans11annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>F
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idtransintcopy')">
		<xsl:variable name="trans" select="@id"/>
		<xsl:variable name="auxg1" select="substring-before(following-sibling::*[1],',')"/>
		<xsl:variable name="auxg2" select="substring-after(following-sibling::*[1],',')"/>
		<xsl:variable name="text" select="text"/>
	
		<xsl:for-each select="//arc[annot/text=$auxg1]">
			<xsl:if test="not(starts-with(placeend/@idref,'idplace2int'))">
			<!--creo arco de ida y vuelta con fail-->
		 <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans22ref22',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans22ref22annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref22trans22',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref22trans22annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
			</xsl:for-each>
			<xsl:for-each select="//arc[annot/text=$auxg2]">
				<xsl:if test="not(starts-with(placeend/@idref,'idplace2int'))">
			<!--creo arco de ida y vuelta con fail-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans23ref23',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans23ref23annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref23trans23',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref23trans23annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
			</xsl:for-each>
		
	</xsl:if>
	
       <xsl:if test="starts-with(@id,'idtransint') and not(starts-with(@id,'idtransintcopy'))">
		<xsl:variable name="trans" select="@id"/>
		<xsl:variable name="auxg1" select="substring-before(following-sibling::*[1],',')"/>
		<xsl:variable name="auxg2" select="substring-after(following-sibling::*[1],',')"/>
		<xsl:variable name="text" select="text"/>
		<xsl:for-each select="//arc[annot/text=$auxg1]">
			<xsl:if test="not(starts-with(placeend/@idref,'idplace2int')) and not(starts-with(placeend/@idref,'idplace1int'))">
			<!--creo arco de ida y vuelta con fail-->
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans12ref12',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/>
		        	</xsl:attribute>	
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans12ref12annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref12trans12',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref12trans12annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
			</xsl:for-each>
			<xsl:for-each select="//arc[annot/text=$auxg2]">
				<xsl:if test="not(starts-with(placeend/@idref,'idplace2int')) and not(starts-with(placeend/@idref,'idplace1int'))">
			<!--creo arco de ida y vuelta con fail-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans20ref20',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans20ref20annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref20trans20',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref20trans20annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:if>
			</xsl:for-each>
		
	</xsl:if>

	<xsl:if test="starts-with(@id,'idtrans_Assigncopy')">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			
			<xsl:for-each select="//arc[(annot/text=$auxg1)]">
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctrans3ref3',$trans)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctrans3ref3annot',$trans)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcref3trans3',$trans)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcref3trans3annot',$trans)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:for-each>
			<xsl:for-each select="//arc[(annot/text=$auxg2)]">
			
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctrans4ref4',$trans)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctrans4ref4annot',$trans)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcref4trans4',$trans)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcref4trans4annot',$trans)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
			</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idtrans_Assign') and not(starts-with(@id,'idtrans_Assigncopy'))">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			<xsl:variable name="text" select="text"/>
			<xsl:for-each select="//arc[(annot/text=$auxg1) and not(starts-with(placeend/@idref,'idplaceg'))]">
		
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransrefannot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcreftrans',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcreftransannot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
		<xsl:for-each select="//arc[(annot/text=$auxg2)and not(starts-with(placeend/@idref,'idplaceg'))]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans2ref2',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref2annot2',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref2trans2',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref2trans2annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idEnd_Workunitt') and (ancestor::CHOICE)">
	
		<xsl:for-each select="//descendant::*[name()='CHOICE']/descendant::*[name()='SEQUENCE']/descendant::*[name()='place']">
			<xsl:value-of select="@id"/>
		</xsl:for-each>
	</xsl:if>
	
<xsl:call-template name="aux3"/>
		

</xsl:template>
<xsl:template name="aux3">
		<xsl:if test="starts-with(@id,'idtimeoutintcopy')">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			<xsl:variable name="text" select="text"/>
			<xsl:for-each select="//arc[(annot/text=$auxg1)]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans26ref26',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans26ref26annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref26trans26',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref26trans26annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
		<xsl:for-each select="//arc[(annot/text=$auxg2)]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans27ref27',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref27annot27',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref27trans27',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref27trans27annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
	</xsl:if>	
	<xsl:if test="starts-with(@id,'idtbworkunit')">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			<xsl:variable name="text" select="text"/>
		
			<xsl:for-each select="//arc[(annot/text=$auxg1)]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans7ref7',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans7ref7annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref7trans7',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref7trans7annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
		<xsl:for-each select="//arc[(annot/text=$auxg2)]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans8ref8',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref8annot8',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref8trans8',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref8trans8annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
	</xsl:if>
	<xsl:call-template name="aux5"/>
</xsl:template>

<xsl:template name="aux4">
	<xsl:if test="(placeend/@idref!='' and transend/@idref!='')">	
		<xsl:call-template name="replace-arc"/>
 </xsl:if> 
 <xsl:if test="contains(transend/@idref,'idtbworkunit') and placeend/@idref=''">
 <xsl:variable name="aux1" select="transend/@idref"/>
 	<xsl:for-each select="//trans">
 		<xsl:if test="contains(@id,$aux1)">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpintbwork',$aux1)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="preceding-sibling::*/@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpintbworkannot',$aux1)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="0"/></text>
		        </xsl:element> 
		      </xsl:element>
 			<xsl:variable name="marca1" select="concat('m',substring-before(following-sibling::*,','))"/>
 			<xsl:variable name="marca2" select="concat('m',substring-after(following-sibling::*,', '))"/>
 			
 			<!--busco el place con cuya marca coincida y creo arco de ida y vuelta con la transicion actual-->
 			<xsl:for-each select="//place[starts-with(@id,'idplace1int') and (initmark/text=$marca1)]">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		     <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 				<xsl:for-each select="//place[starts-with(@id,'idplace2int') and (initmark/text=$marca1)]">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		      <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 			<xsl:for-each select="//place[starts-with(@id,'idplace1_Assign') and (initmark/text=$marca1)]">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		      <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 				
 			<!--busco el place con cuya marca coincida y creo arco de ida y vuelta con la transicion actual-->
 			<xsl:for-each select="//place[starts-with(@id,'idplace1int') and (initmark/text=$marca2)]">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca2,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		     <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca1,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 				<xsl:for-each select="//place[starts-with(@id,'idplace2int') and (initmark/text=$marca2)]">
 				<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca2,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		      <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca2,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 			<xsl:for-each select="//place[starts-with(@id,'idplace1_Assign') and (initmark/text=$marca2)]">
 				<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpt',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcptannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca2,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
		     <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctp',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$aux1"/></xsl:attribute>
		      	</xsl:element> 
		      	 <xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="@id"/>
		        </xsl:attribute>		
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctpannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="substring-after($marca2,'m')"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:for-each>
 			
 	</xsl:if>
 	 	</xsl:for-each>
 </xsl:if>	
 
	
  <xsl:if test="(placeend/@idref='') and starts-with(transend/@idref,'idInit_Parallell')">
 		<xsl:variable name="aux" select="transend/@idref"/>
 		<xsl:value-of select="transend/@idref"/>
 		<xsl:for-each select="//descendant::*[name()='PARALLEL']/descendant::*[name()='SEQUENCE']/child::*[1]">
 		<xsl:if test="starts-with(@id,'idInit_Assign')">
 		<!--creo un arco por cada descendiente del parallel-->
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinparpinx',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        <xsl:element name="transend">
		        	<xsl:attribute name="idref"><xsl:value-of select="$aux"/></xsl:attribute>
		        </xsl:element>
		        <xsl:element name="placeend">
		        	<xsl:attribute name="idref"><xsl:value-of select="@id"/></xsl:attribute>
		        </xsl:element>        
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpinparpinxannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
 	</xsl:if>
 	</xsl:for-each>
 	</xsl:if>
 	<xsl:if test="(placeend/@idref='') and starts-with(transend/@idref,'idEnd_Parallel')">
 		<!--creo un arco por cada pokdel hijo del parallel-->
 		<xsl:variable name="aux" select="transend/@idref"/>
 		
 		<xsl:for-each select="//descendant::*[name()='PARALLEL']/descendant::*[name()='SEQUENCE']/child::*[name()='place']">
 			
 			<xsl:if test="starts-with(@id,'idEnd_Interaction') and not(starts-with(following-sibling::*[1]/@id,'idInit'))">
 			
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcpokxpokpar',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		         <xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		        	<xsl:value-of select="@id"/></xsl:attribute>
		        </xsl:element>   
		        <xsl:element name="transend">
		        	<xsl:attribute name="idref">
		        	<xsl:value-of select="$aux"/></xsl:attribute>
		        </xsl:element>     
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcpokxpokworkunitannot',@id)"/></xsl:attribute>
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
 			</xsl:if>
 		
 		</xsl:for-each>
 	</xsl:if>			
</xsl:template>
<xsl:template name="aux5">
		<xsl:if test="starts-with(@id,'idEnd_Workunitt')">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			<xsl:variable name="text" select="text"/>
			<xsl:for-each select="//arc[(annot/text=$auxg1) and not(starts-with(placeend/@idref,'idplaceg'))]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans5ref5',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans5ref5annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref5trans5',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref5trans5annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
		<xsl:for-each select="//arc[(annot/text=$auxg2 and not(starts-with(placeend/@idref,'idplaceg')))]">
		
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans6ref6',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref6annot6',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref6trans6',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref6trans6annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
	</xsl:if>
	
	<xsl:if test="starts-with(@id,'idtrans_Assign') and not(starts-with(@id,'idtrans_Assigncopy')) and starts-with(following-sibling::*[7]/@id,'idInit')">
 			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranassigninitnext',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="following-sibling::*[7]/@id"/></xsl:attribute>	
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctranassigninitnextannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
 </xsl:if>
		<xsl:if test="starts-with(@id,'idtimeoutint') and not(starts-with(@id,'idtimeoutintcopy'))">
			<xsl:variable name="trans" select="@id"/>
			<xsl:variable name="auxg1" select="substring-before(following-sibling::*,',')"/>
			<xsl:variable name="auxg2" select="substring-after(following-sibling::*,',')"/>
			<xsl:variable name="text" select="text"/>
			<xsl:for-each select="//arc[(annot/text=$auxg1) and not(starts-with(placeend/@idref,'idplace1int')) and not(starts-with(placeend/@idref,'idplace2int'))]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans24ref24',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans24ref24annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref24trans24',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref24trans24annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg1"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
		<xsl:for-each select="//arc[(annot/text=$auxg2)  and not(starts-with(placeend/@idref,'idplace1int')) and not(starts-with(placeend/@idref,'idplace2int'))]">
			<!--creo arco de trans->referencia encontrada en ambas direciones-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctrans25ref25',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      			<xsl:value-of select="placeend/@idref"/></xsl:attribute>
		        		
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarctransref25annot25',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
		    <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref25trans25',placeend/@idref),$text)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="placeend/@idref"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="$trans"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat(concat('idarcref25trans25annot',placeend/@idref),$text)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$auxg2"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:for-each>
	</xsl:if>
	<xsl:if test="starts-with(@id,'idtransintcopy') and starts-with(following-sibling::*[44]/@id,'idInit_Assign')">
		<!--creo arco pin->transcopy-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctranscopynextint',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="following-sibling::*[44]/@id"/>
		        		</xsl:attribute>	
		        </xsl:element> 
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctranscopynextintannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		      <!--creo arco transcopy->pin-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcnextinttranscopy',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="following-sibling::*[44]/@id"/>
		        		</xsl:attribute>	
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcnextinttranscopyannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
		      </xsl:if>
		      
		      <xsl:if test="starts-with(@id,'idfail1int2') and starts-with(following-sibling::*[42]/@id,'idInit_Assign')">
		      
		      <!--creo arco de pin->fail1int2-->
		     <xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarcnextinttranscopy',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationpt"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		        
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="following-sibling::*[42]/@id"/>
		        		</xsl:attribute>	
		        </xsl:element>    
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarcnextinttranscopyannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:if>	
	<xsl:if test="starts-with(@id,'idtrans_Assign') and starts-with(following::*[11]/@id,'idInit_Workunit')">

			<!--creo arco de union-->
			<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctransassinginiwork',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element> 
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">	
		      		<xsl:value-of select="following::*[11]/@id"/>
		        		</xsl:attribute>
		        </xsl:element>    
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctransassinginiworkannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:if>
	
	<xsl:if test="starts-with(@id,'idtransint') and starts-with(following-sibling::*[46]/@id,'idInit_Assign')">
		<!--creo acto de tranint->initsiguiente-->
		<xsl:element name="arc">
			<xsl:attribute name="id"><xsl:value-of select="concat('idarctransintinitassginnext',@id)"/></xsl:attribute>
			<xsl:attribute name="orientation"><xsl:value-of select="$orientationtp"/></xsl:attribute>
			<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		        <posattr x="0.000000"
		                 y="0.000000"/>
		        <fillattr colour="White"
		                  pattern=""
		                  filled="false"/>
		        <lineattr colour="Black"
		                  thick="1"
		                  type="Solid"/>
		        <textattr colour="Black"
		                  bold="false"/>
		        <arrowattr headsize="1.200000"
		                   currentcyckle="2"/>
		      	  
		         
		      	
		        <xsl:element name="transend">
		      	<xsl:attribute name="idref">
		      		<xsl:value-of select="@id"/></xsl:attribute>
		      	</xsl:element>    
		      	<xsl:element name="placeend">
		        	<xsl:attribute name="idref">
		      			<xsl:value-of select="following-sibling::*[46]/@id"/></xsl:attribute>
		        			
		        </xsl:element> 
		        <xsl:element name="annot">
		        	<xsl:attribute name="id"><xsl:value-of select="concat('idarctransintinitassginnextannot',@id)"/></xsl:attribute>
		         
		          <posattr x="-25.000000"
		                   y="50.000000"/>
		          <fillattr colour="White"
		                    pattern="Solid"
		                    filled="false"/>
		          <lineattr colour="Black"
		                    thick="0"
		                    type="Solid"/>
		          <textattr colour="Black"
		                    bold="false"/>
		          <text tool="CPN Tools"
		                version="2.2.0"><xsl:value-of select="$x"/></text>
		        </xsl:element> 
		      </xsl:element>
	</xsl:if>

</xsl:template>
</xsl:stylesheet>