title: Using <br /> tag within XML for XSLT
body: <p>I am currently running into some trouble with an XML/XSLT to HTML conversion I am working on. 
  In short, I want to use <code>&lt;br /&gt;</code> tags within an XML tag, so that the HTML file after transformation will display a line break. After some tries I got that to work, however at the cost of some other functionality. Namely the ability to highlight parts.</p>
  
  <p>First the dumped down XML file. So basically, there are several possible tags which all contain a first and last name. In this case I want the first and last name to be parsed on a separate line (hence the <code>&lt;br /&gt;</code> tag). Furthermore in some instances a first or last name will need to be highlighted. In this case on line 3, last name "The Hand".</p>
  
  <pre><code>&lt;swift_native&gt;
  &lt;tag tag_code=":1:"&gt;&lt;![CDATA[Jaco&lt;br /&gt;Ronnie]]&gt;&lt;/tag&gt;
  &lt;tag tag_code=":2:"&gt;&lt;![CDATA[John&lt;br /&gt;Doe]]&gt;&lt;/tag&gt;
  &lt;tag tag_code=":2:"&gt;&lt;![CDATA[Robbie&lt;br /&gt;]]&gt;&lt;highlight&gt;The Hand&lt;/highlight&gt;&lt;/tag&gt;
  &lt;/swift_native&gt;
  </code></pre>
  
  <p>So far, depending on the method I use within the XSLT I either am able to get the linebreaks correct or the highlighting. But not both: The following figure shows this.</p>
  
  <p><img src="https://i.imgur.com/LeMXWxq.png" alt="output">
  Below you see the used XSLT file. Where you can see that using <code>&lt;xsl:apply-templates/&gt;</code> will make the highlighting work and <code>&lt;xsl:value-of select="." disable-output-escaping="yes"/&gt;</code> will let me use the <code>&lt;br /&gt;</code> correctly.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;!-- HTML Layout definition --&gt;
  &lt;xsl:output method="html"/&gt;
  &lt;xsl:template match="swift_native"&gt;
  
      &lt;html&gt;
          &lt;head&gt;
              &lt;title&gt;
                  &lt;xsl:apply-templates select="message_id"/&gt;
              &lt;/title&gt;
              &lt;style type="text/css"&gt;
                  #tbl1,#tbl2 {display:none;}
                  #lnk1,#lnk2   {border:none;background:none;width:85px;}
                  td {FONT-SIZE: 75%; MARGIN: 0px; COLOR: #000000;}
                  td {FONT-FAMILY: verdana,helvetica,arial,sans-serif}
                  a {TEXT-DECORATION: none;}
                  table.subtable {border-collapse:collapse;}
                  table.subtable td {border:1px solid black;}
              &lt;/style&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;table cellpadding="3" width="100%" class="subtable"&gt;
                  &lt;tr bgcolor="#cccccc"&gt;
                      &lt;td colspan="3"&gt;Block4&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;xsl:apply-templates select="tag" /&gt;
              &lt;/table&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  &lt;/xsl:template&gt;
  
  &lt;!-- Variable definition --&gt;
  
  &lt;xsl:template match="tag"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;b&gt;
                  &lt;xsl:value-of select="@tag_code" /&gt;
              &lt;/b&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;xsl:value-of select="." disable-output-escaping="yes"/&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;xsl:apply-templates/&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="highlight"&gt;
      &lt;span style="background-color:yellow;"&gt;
          &lt;xsl:apply-templates/&gt;
      &lt;/span&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Obviously, the question is: does someone know a way in which I can use both the <code>&lt;br /&gt;</code> tag and the highlighting? </p>