<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xsl:template match="/">
		<html>
			<head/>
			<body>
				<xsl:for-each select="EXAMPLES">
					<xsl:for-each select="example">
						<xsl:for-each select="structure">
							<xsl:for-each select="constituent">
								<xsl:for-each select="FUNCTIONS">
									<xsl:for-each select="FUNCTION">
										<xsl:if test="position()=1">
											<xsl:text disable-output-escaping="yes">&lt;table border="1"&gt;</xsl:text>
										</xsl:if>
										<xsl:if test="position()=1">
											<thead>
												<tr>
													<td valign="top">METAFUNCTION</td>
												</tr>
											</thead>
										</xsl:if>
										<xsl:if test="position()=1">
											<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
										</xsl:if>
										<tr>
											<td valign="top">
												<xsl:for-each select="@METAFUNCTION">
													<xsl:value-of select="."/>
												</xsl:for-each>
											</td>
										</tr>
										<xsl:if test="position()=last()">
											<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
										</xsl:if>
										<xsl:if test="position()=last()">
											<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
										</xsl:if>
									</xsl:for-each>
								</xsl:for-each>
							</xsl:for-each>
						</xsl:for-each>
						<xsl:for-each select="preselections">
							<xsl:if test="position()=1">
								<xsl:text disable-output-escaping="yes">&lt;table border="1"&gt;</xsl:text>
							</xsl:if>
							<xsl:if test="position()=1">
								<thead>
									<tr>
										<td valign="top">preselection</td>
									</tr>
								</thead>
							</xsl:if>
							<xsl:if test="position()=1">
								<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
							</xsl:if>
							<tr>
								<td valign="top">
									<xsl:for-each select="preselection">
										<xsl:for-each select="/">
											<html>
												<head/>
												<body>
													<xsl:for-each select="EXAMPLES">
														<xsl:for-each select="example">
															<xsl:for-each select="preselections">
																<xsl:for-each select="preselection">
																	<xsl:if test="position()=1">
																		<xsl:text disable-output-escaping="yes">&lt;table border="1"&gt;</xsl:text>
																	</xsl:if>
																	<xsl:if test="position()=1">
																		<thead>
																			<tr>
																				<td valign="top">unit</td>
																				<td valign="top">f</td>
																			</tr>
																		</thead>
																	</xsl:if>
																	<xsl:if test="position()=1">
																		<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
																	</xsl:if>
																	<tr>
																		<td valign="top">
																			<xsl:for-each select="unit">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																		<td valign="top">
																			<xsl:for-each select="f">
																				<xsl:apply-templates/>
																			</xsl:for-each>
																		</td>
																	</tr>
																	<xsl:if test="position()=last()">
																		<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
																	</xsl:if>
																	<xsl:if test="position()=last()">
																		<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
																	</xsl:if>
																</xsl:for-each>
															</xsl:for-each>
														</xsl:for-each>
													</xsl:for-each>
												</body>
											</html>
										</xsl:for-each>
									</xsl:for-each>
								</td>
							</tr>
							<xsl:if test="position()=last()">
								<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
							</xsl:if>
							<xsl:if test="position()=last()">
								<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
							</xsl:if>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="example">
						<xsl:for-each select="structure">
							<xsl:for-each select="constituent">
								<xsl:if test="position()=1">
									<table border="1">
										<xsl:if test="position()=1">
											<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
										</xsl:if>
										<tr>
											<td valign="top">LEXEME</td>
											<xsl:for-each select="../constituent">
												<td valign="top">
													<xsl:for-each select="LEXEME">
														<xsl:apply-templates/>
													</xsl:for-each>
												</td>
											</xsl:for-each>
										</tr>
										<tr>
											<td valign="top">subconstituents</td>
											<xsl:for-each select="../constituent">
												<td valign="top">
													<xsl:for-each select="subconstituents">
														<xsl:if test="position()=1">
															<table border="1">
																<xsl:if test="position()=1">
																	<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
																</xsl:if>
																<tr>
																	<td valign="top">string</td>
																	<xsl:for-each select="../subconstituents">
																		<td valign="top">
																			<xsl:for-each select="string">
																				<span style="color:aqua">
																					<span style="color:aqua">
																						<xsl:apply-templates/>
																					</span>
																				</span>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<tr>
																	<td valign="top">constituent</td>
																	<xsl:for-each select="../subconstituents">
																		<td valign="top">
																			<xsl:for-each select="constituent">
																				<xsl:for-each select="subconstituents">
																					<xsl:if test="position()=1">
																						<xsl:text disable-output-escaping="yes">&lt;table border="1"&gt;</xsl:text>
																					</xsl:if>
																					<xsl:if test="position()=1">
																						<thead>
																							<tr/>
																						</thead>
																					</xsl:if>
																					<xsl:if test="position()=1">
																						<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
																					</xsl:if>
																					<tr/>
																					<xsl:if test="position()=last()">
																						<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
																					</xsl:if>
																					<xsl:if test="position()=last()">
																						<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
																					</xsl:if>
																				</xsl:for-each>
																			</xsl:for-each>
																		</td>
																	</xsl:for-each>
																</tr>
																<xsl:if test="position()=last()">
																	<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
																</xsl:if>
															</table>
														</xsl:if>
													</xsl:for-each>
												</td>
											</xsl:for-each>
										</tr>
										<xsl:if test="position()=last()">
											<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
										</xsl:if>
									</table>
								</xsl:if>
							</xsl:for-each>
						</xsl:for-each>
					</xsl:for-each>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
