Hola , quiero hacer un directorio cargando datos de un xml en una pagina xslt, pero no se cual es el codigo que debo de usar, lo que he logrado al repetir la region es algo asi:

A---Ana Rodriguez
A-- Alma Vega
B---Benito Lopez
B---Brenda Jimenez

Lo que quisiera es que aparezca una sola vez la letra inicial y despues todos los nombres que empiezan con esa letra.

este es mi codigo XML:

Código XML :

<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href='Directorio.xsl' type='text/xsl'?>
<dataroot>
   <flsdata>
      <Inicial>A</Inicial>
      <Agente>ALMA SONIA EZQUIVEL MARTINEZ</Agente>
      <Tel1>55268345</Tel1>
      <Tel2>55268345</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>A</Inicial>
      <Agente>ARTURO GONZALEZ ROMERO</Agente>
      <Tel1>712344550</Tel1>
      <Tel2>7121271432</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>C</Inicial>
      <Agente>CINTHIA HERNANDEZ VILLEGAS</Agente>
      <Tel1>7221544673</Tel1>
      <Tel2>7221544673</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>E</Inicial>
      <Agente>EDUARDO JUAREZ SANCHEZ</Agente>
      <Tel1>7232236541</Tel1>
      <Tel2>7232236541</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>E</Inicial>
      <Agente>ESTEBAN SANCHEZ LOPEZ</Agente>
      <Tel1>7256273456</Tel1>
      <Tel2>7256273456</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>K</Inicial>
      <Agente>KAREN AGUILAR MANCILLA</Agente>
      <Tel1>7223753300</Tel1>
      <Tel2>7223753300</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>M</Inicial>
      <Agente>MARINA ALEJANDRA TORRES PAZ</Agente>
      <Tel1>723457611</Tel1>
      <Tel2>722878711</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>M</Inicial>
      <Agente>MARTHA PONCE HERNANDEZ</Agente>
      <Tel1>7231452563</Tel1>
      <Tel2>7231452563</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>P</Inicial>
      <Agente>PEDRO CORTES PEREZ</Agente>
      <Tel1>7222141435</Tel1>
      <Tel2>723909011</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
   <flsdata>
      <Inicial>S</Inicial>
      <Agente>SANDRA ESQUIVEL CORONA</Agente>
      <Tel1>7222513344</Tel1>
      <Tel2>7222513344</Tel2>
      <Email>[email protected]</Email>
   </flsdata>
</dataroot>




Y este el codigo Xsl:

Código HTML :

<?xml version="1.0" encoding="UTF-8"?><!-- DWXMLSource="Directorio.xml" -->
<!DOCTYPE xsl:stylesheet  [
   <!ENTITY nbsp   " ">
   <!ENTITY copy   "©">
   <!ENTITY reg    "®">
   <!ENTITY trade  "™">
   <!ENTITY mdash  "—">
   <!ENTITY ldquo  "“">
   <!ENTITY rdquo  "”"> 
   <!ENTITY pound  "£">
   <!ENTITY yen    "¥">
   <!ENTITY euro   "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Directorio</title>
<style type="text/css">
<xsl:comment>
body {
   background-color: #000011;
}
#title {
   position:absolute;
   left:782px;
   top:116px;
   width:228px;
   height:24px;
   z-index:1;
}
</xsl:comment>
</style>
</head>

<body>

  <div align="center">
    <table width="1024" height="90" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <th scope="col">&nbsp;</th>
        </tr>
      </table>
    <table width="1024" height="33" border="0" cellpadding="0" cellspacing="0" class="header" id="header">
      <tr>
        <th width="1024" height="33" scope="col">&nbsp;</th>
        </tr>
    </table>
    <table width="1010" height="193" border="0" cellpadding="0" cellspacing="0" class="resize">
      <tr>
        <td height="57" align="center" valign="top" bgcolor="#999999" id="lateral" scope="col"><p>&nbsp;</p>          </td>
          <th colspan="6" bgcolor="#FFFFFF" class="title" scope="col">&nbsp;</th>
        </tr>

        <tr>
          <td height="20" valign="top" bgcolor="#999999" id="lateral" scope="col">&nbsp;</td>
          <th width="28" bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th width="282" bgcolor="#FFFFFF" scope="col">&nbsp;</th>
          <th width="282" bgcolor="#FFFFFF" scope="col">NOMBRE </th>
          <th bgcolor="#FFFFFF" scope="col">EMAIL</th>
          <th bgcolor="#FFFFFF" scope="col">TELEFONO1</th>
          <th width="309" bgcolor="#FFFFFF" scope="col">TELEFONO 2 </th>
        </tr>
         
          <xsl:for-each select="dataroot/flsdata">
            <xsl:for-each select=".">
              <tr>
                <td height="20" valign="top" bgcolor="#999999" id="lateral" scope="col">&nbsp;</td>
                <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
                <th nowrap="nowrap" bgcolor="#FFFFFF" scope="col"><xsl:value-of select="Inicial"/></th>
                <th nowrap="nowrap" bgcolor="#FFFFFF" scope="col"><xsl:value-of select="Agente"/></th>
                <th width="163" nowrap="nowrap" bgcolor="#FFFFFF" scope="col"><xsl:value-of select="Email"/></th>
                <th width="97" nowrap="nowrap" bgcolor="#FFFFFF" scope="col"><xsl:value-of select="Tel1"/></th>
                <th nowrap="nowrap" bgcolor="#FFFFFF" scope="col"><xsl:value-of select="Tel2"/></th>
              </tr>
            </xsl:for-each>
          </xsl:for-each>
       
        
      <tr>
        <td width="85" height="76" valign="top" bgcolor="#999999" id="lateral" scope="col">&nbsp;</td>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
          <th bgcolor="#FFFFFF" class="table" scope="col">&nbsp;</th>
        </tr>
    </table>
    <table width="1024" height="30" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th scope="col">&nbsp;</th>
        </tr>
    </table>
  </div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>



Espero que alguien me pueda asesorar. Muchas gracias