<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:c="http://livestoryboard.com/lsb/schemas/2003/03/content" xmlns:x1="http://livestoryboard.com/lsb/schemas/2003/03/xhtml1" exclude-result-prefixes="x1">

  <xsl:output method="xml" indent="yes" encoding="utf-8"/>

  <xsl:strip-space elements="*"/>


  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  
  
  <xsl:template match="x1:UL">
    
    <xsl:if test="not(boolean(local-name(preceding-sibling::*[1])='UL'))">
  
      <xsl:copy>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates/>
            
        <xsl:if test="boolean(local-name(following-sibling::*[1])='UL')">
          <xsl:apply-templates select="following-sibling::*[1]" mode="ul_aggregator"/>
        </xsl:if>
        
      </xsl:copy>
    </xsl:if>
    
  </xsl:template>
  

  <xsl:template match="x1:UL" mode="ul_aggregator">

    <xsl:apply-templates/>
    
    <xsl:if test="boolean(local-name(following-sibling::*[1])='UL')">
      <xsl:apply-templates select="following-sibling::*[1]" mode="ul_aggregator"/>
    </xsl:if>
    
  </xsl:template>
  
  
  <!--
  <xsl:template match="x1:P">
  
    <xsl:choose>
      <xsl:when test="count(child::*) = 1 and boolean(child::x1:STRONG)">
            
        <c:title>
          <xsl:value-of select="x1:STRONG"/>
        </c:title>
        
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy>
          <xsl:copy-of select="@*"/>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:otherwise>
    </xsl:choose>
  
  </xsl:template>
  -->
  
</xsl:stylesheet>
