<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output omit-xml-declaration="yes" encoding="UTF-8"/> 
	<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<AllViolations>
		<xsl:for-each select="AllViolations/AccidentViolation">
		<xsl:sort select="AccidentViolationDt"/>
			<AccidentViolation>
				  <AccidentViolationDt><xsl:value-of select="AccidentViolationDt"/></AccidentViolationDt>
				  <AccidentViolationDesc><xsl:value-of select="AccidentViolationDesc"/></AccidentViolationDesc> 
				  <com.hmic_AccidentViolationType><xsl:value-of select="com.hmic_AccidentViolationType"/></com.hmic_AccidentViolationType> 
				  <com.hmic_AVID><xsl:value-of select="com.hmic_AVID"/></com.hmic_AVID> 
   				  <com.hmic_DriverName><xsl:value-of select="com.hmic_DriverName"/></com.hmic_DriverName>
				  <com.hmic_Addr1><xsl:value-of select="com.hmic_Addr1"/></com.hmic_Addr1> 
				  <com.hmic_CityStZip><xsl:value-of select="com.hmic_CityStZip"/></com.hmic_CityStZip> 
				  <com.hmic_DLNumber><xsl:value-of select="com.hmic_DLNumber"/></com.hmic_DLNumber> 
				  <com.hmic_DOB><xsl:value-of select="com.hmic_DOB"/></com.hmic_DOB> 
				  <com.hmic_Gender><xsl:value-of select="com.hmic_Gender"/></com.hmic_Gender> 
				  <com.hmic_HMICAttributeCd><xsl:value-of select="com.hmic_HMICAttributeCd"/></com.hmic_HMICAttributeCd> 
				  <com.hmic_HMICSurchargePtValue1><xsl:value-of select="com.hmic_HMICSurchargePtValue1"/></com.hmic_HMICSurchargePtValue1> 
				  <com.hmic_HMICSurchargePtValueE><xsl:value-of select="com.hmic_HMICSurchargePtValueE"/></com.hmic_HMICSurchargePtValueE> 
				  <com.hmic_HMICSurchargePts><xsl:value-of select="com.hmic_HMICSurchargePts"/></com.hmic_HMICSurchargePts> 
				  <com.hmic_HMICSurchargeFlag><xsl:value-of select="com.hmic_HMICSurchargeFlag"/></com.hmic_HMICSurchargeFlag> 
				  <com.hmic_ExcludeFromMatching><xsl:value-of select="com.hmic_ExcludeFromMatching"/></com.hmic_ExcludeFromMatching> 
				  <xsl:if test="com.hmic_AccidentViolationType='APA'">
				  	<com.hmic_CompanyClaimNbr><xsl:value-of select="com.hmic_CompanyClaimNbr"/></com.hmic_CompanyClaimNbr> 
				  	<LossPayment><xsl:value-of select="LossPayment"/></LossPayment>
					<com.hmic_Relation><xsl:value-of select="com.hmic_Relation"/></com.hmic_Relation>
					<com.hmic_VIN><xsl:value-of select="com.hmic_VIN"/></com.hmic_VIN>
					<com.hmic_VehicleDescript><xsl:value-of select="com.hmic_VehicleDescript"/></com.hmic_VehicleDescript>
					<com.hmic_FaultIndicator><xsl:value-of select="com.hmic_FaultIndicator"/></com.hmic_FaultIndicator>
					<com.hmic_PolicyNumber><xsl:value-of select="com.hmic_PolicyNumber"/></com.hmic_PolicyNumber>
					<com.hmic_Carrier><xsl:value-of select="com.hmic_Carrier"/></com.hmic_Carrier>
					<com.hmic_PolicyType><xsl:value-of select="com.hmic_PolicyType"/></com.hmic_PolicyType>
					<xsl:for-each select="com.hmic_LossCause">
					<com.hmic_LossCause>
						<com.hmic_ClaimStatus><xsl:value-of select="com.hmic_ClaimStatus"/></com.hmic_ClaimStatus>
						<com.hmic_CoverageCd><xsl:value-of select="com.hmic_CoverageCd"/></com.hmic_CoverageCd>
						<com.hmic_LossType><xsl:value-of select="com.hmic_LossType"/></com.hmic_LossType>
						<com.hmic_IterationNbr><xsl:value-of select="com.hmic_IterationNbr"/></com.hmic_IterationNbr>
						<com.hmic_AccidentViolationDesc><xsl:value-of select="com.hmic_AccidentViolationDesc"/></com.hmic_AccidentViolationDesc>
						<com.hmic_LossPayment><xsl:value-of select="com.hmic_LossPayment"/></com.hmic_LossPayment>
						<com.hmic_LossTypeCd><xsl:value-of select="com.hmic_LossTypeCd"/></com.hmic_LossTypeCd>
					</com.hmic_LossCause>
					</xsl:for-each>
					<com.hmic_DLState><xsl:value-of select="com.hmic_DLState"/></com.hmic_DLState>
					<com.hmic_ThirdParty><xsl:value-of select="com.hmic_ThirdParty"/></com.hmic_ThirdParty>
					<com.hmic_IsLossChargeable><xsl:value-of select="com.hmic_IsLossChargeable"/></com.hmic_IsLossChargeable>
				  </xsl:if>
				  <xsl:if test="com.hmic_AccidentViolationType='MVR'">
	  				  <ConvictionDt><xsl:value-of select="ConvictionDt"/></ConvictionDt>
					  <NumSurchargePoints><xsl:value-of select="NumSurchargePoints"/></NumSurchargePoints> 
					  <AccidentViolationCd><xsl:value-of select="AccidentViolationCd"/></AccidentViolationCd> 
					  <com.hmic_DriverNumber><xsl:value-of select="com.hmic_DriverNumber"/></com.hmic_DriverNumber> 
					  <com.hmic_MVRStatus><xsl:value-of select="com.hmic_MVRStatus"/></com.hmic_MVRStatus>
					  <com.hmic_VendorReportNo><xsl:value-of select="com.hmic_VendorReportNo"/></com.hmic_VendorReportNo> 
					  <com.hmic_ReportDate><xsl:value-of select="com.hmic_ReportDate"/></com.hmic_ReportDate> 
					  <com.hmic_LicenseState><xsl:value-of select="com.hmic_LicenseState"/></com.hmic_LicenseState> 				  
					  <com.hmic_SSN><xsl:value-of select="com.hmic_SSN"/></com.hmic_SSN> 
					  <com.hmic_DMVAcctNo><xsl:value-of select="com.hmic_DMVAcctNo"/></com.hmic_DMVAcctNo> 
					  <com.hmic_Height><xsl:value-of select="com.hmic_Height"/></com.hmic_Height> 
					  <com.hmic_Weight><xsl:value-of select="com.hmic_Weight"/></com.hmic_Weight> 
					  <com.hmic_EyeColor><xsl:value-of select="com.hmic_EyeColor"/></com.hmic_EyeColor> 
					  <com.hmic_HairColor><xsl:value-of select="com.hmic_HairColor"/></com.hmic_HairColor> 
					  <com.hmic_DriverClass><xsl:value-of select="com.hmic_DriverClass"/></com.hmic_DriverClass> 
					  <com.hmic_DriverStatus><xsl:value-of select="com.hmic_DriverStatus"/></com.hmic_DriverStatus> 
					  <com.hmic_DateIssued><xsl:value-of select="com.hmic_DateIssued"/></com.hmic_DateIssued> 
					  <com.hmic_DateExpires><xsl:value-of select="com.hmic_DateExpires"/></com.hmic_DateExpires> 
					  <com.hmic_Restrictions><xsl:value-of select="com.hmic_Restrictions"/></com.hmic_Restrictions> 
					  <xsl:for-each select="../com.hmic_MiscData">
					  <com.hmic_MiscData>
						  <com.hmic_MiscDataText><xsl:value-of select="com.hmic_MiscDataText"/></com.hmic_MiscDataText> 
					  </com.hmic_MiscData>
					  </xsl:for-each>
					  <com.hmic_ViolationType><xsl:value-of select="com.hmic_ViolationType"/></com.hmic_ViolationType> 
					  <com.hmic_ViolationCd><xsl:value-of select="com.hmic_ViolationCd"/></com.hmic_ViolationCd> 
					  <com.hmic_StdViolationCdDesc><xsl:value-of select="com.hmic_StdViolationCdDesc"/></com.hmic_StdViolationCdDesc> 
					  <com.hmic_HMICAttributeCdDesc><xsl:value-of select="com.hmic_HMICAttributeCdDesc"/></com.hmic_HMICAttributeCdDesc> 
					  <com.hmic_HMICEligibilityPts><xsl:value-of select="com.hmic_HMICEligibilityPts"/></com.hmic_HMICEligibilityPts> 
					  <com.hmic_EligibilityPtsFlag><xsl:value-of select="com.hmic_EligibilityPtsFlag"/></com.hmic_EligibilityPtsFlag> 
					  <com.hmic_IsInEligible><xsl:value-of select="com.hmic_IsInEligible"/></com.hmic_IsInEligible> 
					  <com.hmic_MVRIterationNumber><xsl:value-of select="com.hmic_MVRIterationNumber"/></com.hmic_MVRIterationNumber> 
				  </xsl:if>
			</AccidentViolation>
		</xsl:for-each>
		</AllViolations>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\Documents and Settings\peelrya\Desktop\xml1.xml" htmlbaseurl="" outputurl="" processortype="internal" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="..\..\..\Documents and Settings\peelrya\Desktop\xml1.xml" srcSchemaRoot="AllViolations" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="allviolations/xsl:for&#x2D;each" x="247" y="36"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if/=[0]" x="241" y="34"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if" x="287" y="36"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if/xsl:for&#x2D;each" x="207" y="36"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if[1]/=[0]" x="121" y="34"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if[1]" x="167" y="36"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if[1]/xsl:for&#x2D;each" x="127" y="36"/><block path="allviolations/xsl:for&#x2D;each/accidentviolation/xsl:if[1]/xsl:for&#x2D;each/com.hmic_MiscData/com.hmic_MiscDataText/xsl:value&#x2D;of" x="87" y="36"/></template></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->