<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xalan="http://xml.apache.org/xslt" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
	<xsl:output version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="no" media-type="text/html"/>
	<xsl:template name="mmddyyyy_to_ddmmyyyy">
		<xsl:param name="p1"/>
		<xsl:variable name="date" select="normalize-space($p1)"/>
		<xsl:value-of select="substring($date,4,3)"/>
		<xsl:value-of select="substring($date,1,3)"/>
		<xsl:value-of select="substring($date,7,4)"/>
	</xsl:template>
	<xsl:template match="/">
		<html>
			<head>
				<title/>
			</head>
			<body>
				<h1>Referral From GMS</h1>
				<br/>
				<table border="1">
					<tbody>
						<tr>
							<td>Incident</td>
							<xsl:for-each select="soap:Envelope/soap:Body/CreateIncidentFromReferralRequest">
								<td>
									<table border="1">
										<tbody>
											<tr>
												<td>RefNo</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="RefNo">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>ReferralId</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="ReferralId">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>MatchNo</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="MatchNo">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>RuleNo</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="RuleNo">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>CustBranchOfficeCodeRegion</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="CustBranchOfficeCodeRegion">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>CustGeoAreaCode</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="CustGeoAreaCode">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>ReferralSensitivityFlag</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="ReferralSensitivityFlag">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>CustBenefitType</td>
												<xsl:for-each select="Incident">
													<td>
														<xsl:for-each select="CustBenefitType">
															<xsl:apply-templates/>
														</xsl:for-each>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>SuspectA</td>
												<xsl:for-each select="Incident">
													<td>
														<table border="1">
															<tbody>
																<tr>
																	<td>ReferenceNo</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="ReferenceNo">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>SensitivityMarker</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="SensitivityMarker">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Surname</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="Surname">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Forename</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="Forename">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Nino</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="Nino">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>DateOfBirth</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="DateOfBirth">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Sex</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<xsl:for-each select="Sex">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Address</td>
																	<xsl:for-each select="SuspectA">
																		<td>
																			<table border="1">
																				<tbody>
																					<tr>
																						<td>Address1</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address1">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address2</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address2">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address3</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address3">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address4</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address4">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>PostCode</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="PostCode">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																				</tbody>
																			</table>
																		</td>
																	</xsl:for-each>
																</tr>
															</tbody>
														</table>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>SuspectB</td>
												<xsl:for-each select="Incident">
													<td>
														<table border="1">
															<tbody>
																<tr>
																	<td>ReferenceNo</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="ReferenceNo">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>SensitivityMarker</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="SensitivityMarker">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Surname</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="Surname">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Forename</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="Forename">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Nino</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="Nino">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>DateOfBirth</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="DateOfBirth">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Sex</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<xsl:for-each select="Sex">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Address</td>
																	<xsl:for-each select="SuspectB">
																		<td>
																			<table border="1">
																				<tbody>
																					<tr>
																						<td>Address1</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address1">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address2</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address2">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address3</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address3">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>Address4</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="Address4">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>PostCode</td>
																						<xsl:for-each select="Address">
																							<td>
																								<xsl:for-each select="PostCode">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																				</tbody>
																			</table>
																		</td>
																	</xsl:for-each>
																</tr>
															</tbody>
														</table>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>SuspectAAssociate</td>
												<xsl:for-each select="Incident">
													<td>
														<table border="1">
															<tbody>
																<tr>
																	<td>Surname</td>
																	<xsl:for-each select="SuspectAAssociate">
																		<td>
																			<xsl:for-each select="Surname">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Forename</td>
																	<xsl:for-each select="SuspectAAssociate">
																		<td>
																			<xsl:for-each select="Forename">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Nino</td>
																	<xsl:for-each select="SuspectAAssociate">
																		<td>
																			<xsl:for-each select="Nino">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>DateOfBirth</td>
																	<xsl:for-each select="SuspectAAssociate">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="DateOfBirth">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
															</tbody>
														</table>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>SuspectBAssociate</td>
												<xsl:for-each select="Incident">
													<td>
														<table border="1">
															<tbody>
																<tr>
																	<td>Surname</td>
																	<xsl:for-each select="SuspectBAssociate">
																		<td>
																			<xsl:for-each select="Surname">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Forename</td>
																	<xsl:for-each select="SuspectBAssociate">
																		<td>
																			<xsl:for-each select="Forename">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>Nino</td>
																	<xsl:for-each select="SuspectBAssociate">
																		<td>
																			<xsl:for-each select="Nino">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>DateOfBirth</td>
																	<xsl:for-each select="SuspectBAssociate">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="DateOfBirth">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
															</tbody>
														</table>
													</td>
												</xsl:for-each>
											</tr>
											<tr>
												<td>OtherData</td>
												<xsl:for-each select="Incident">
													<td>
														<table border="1">
															<tbody>
																<tr>
																	<td>CustExtractDate</td>
																	<xsl:for-each select="OtherData">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="CustExtractDate">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>MatchDate</td>
																	<xsl:for-each select="OtherData">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="MatchDate">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>CustNoOfDeps</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="CustNoOfDeps">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>CustNumOfNonDeps</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="CustNoOfNonDeps">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkBenefitType</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkBenefitType">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkExtractDate</td>
																	<xsl:for-each select="OtherData">
																		<td>
																		<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="LinkExtractDate">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkBranchOfficeCode</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkBranchOfficeCode">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkGeoAreaCode</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkGeoAreaCode">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkNoOfDeps</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkNoOfDeps">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkNoOfNonDeps</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkNoOfNonDeps">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>CustRecordType</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="CustRecordType">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>CustAssocRecordType</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="CustAssocRecordType">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkRecordType</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkRecordType">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>LinkAssocRecordType</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="LinkAssocRecordType">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>ProjectInd</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="ProjectInd">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>QualityRuleId</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="QualityRuleId">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>ProcessStatusId</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="ProcessStatusId">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>ImportDate</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:call-template name="mmddyyyy_to_ddmmyyyy">
																			<xsl:with-param name="p1" select="ImportDate">
																				<!-- xsl:apply-templates/-->
																			</xsl:with-param>
																			</xsl:call-template>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>CentralRefNo</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="CentralRefNo">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>WeekNo</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="WeekNo">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>FileExt</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="FileExt">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>RandomSelect</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<xsl:for-each select="RandomSelect">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td>AdditionalInfo</td>
																	<xsl:for-each select="OtherData">
																		<td>
																			<table border="1">
																				<tbody>
																					<tr>
																						<td>TextLabel</td>
																						<xsl:for-each select="AdditionalInfo">
																							<td>
																								<xsl:for-each select="TextLabel">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																					<tr>
																						<td>AddInfo</td>
																						<xsl:for-each select="AdditionalInfo">
																							<td>
																								<xsl:for-each select="AddInfo">
																									<xsl:apply-templates/>
																								</xsl:for-each>
																							</td>
																						</xsl:for-each>
																					</tr>
																				</tbody>
																			</table>
																		</td>
																	</xsl:for-each>
																</tr>
															</tbody>
														</table>
													</td>
												</xsl:for-each>
											</tr>
										</tbody>
									</table>
								</td>
							</xsl:for-each>
						</tr>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
