Inserting characters into existing sequence of strings in XSLT 2.0
<p>I have a structure like this:</p>

<pre><code>&lt;faults&gt;
  &lt;fault componentName="comp1"&gt;
    &lt;introduceWhen&gt;Time1&lt;/introduceWhen&gt;
    &lt;signals&gt;
      &lt;signal name="sig11" value="1"/&gt;
      &lt;signal name="sig22" value="1"/&gt;
    &lt;/signals&gt;
  &lt;/fault&gt;
  &lt;fault componentName="comp2"&gt;
    &lt;introduceWhen&gt;Time2&lt;/introduceWhen&gt;
    &lt;signals&gt;
      &lt;signal name="sig44" value="0"/&gt;
    &lt;/signals&gt;
  &lt;/fault&gt;
&lt;/faults&gt;
</code></pre>

<p>I would like to gather up the values of all the signals under each fault and put them into a title attribute so that I can show detailed info about a fault when hovering over that specific table cell. I have managed to get the info I need into a sequence of strings, like so:</p>

<pre><code>&lt;td title="comp1 sig11 1 sig22 1 comp2 sig44 0"&gt;comp1 1 1 Time1 comp2 0 Time2&lt;/td&gt;
</code></pre>

<p>Using this:</p>

<pre><code>&lt;xsl:template match="faults"&gt;
  &lt;xsl:attribute name="title"&gt;
    &lt;xsl:value-of select="fault/@componentName | 
                          fault/signals/signal/@name | 
                          fault/signals/signal/@value"/&gt;
  &lt;/xsl:attribute&gt;
  &lt;xsl:value-of select="fault/introduceWhen | fault/@componentName |
                        fault/signals/signal/@value"/&gt;
&lt;/xsl:template&gt;
</code></pre>

<p>But what I would like to have is this (the <code>&amp;#xA;</code> are newlines):</p>

<pre><code>&lt;td title="comp1&amp;#xA;sig11: 1&amp;#xA;sig22: 1&amp;#xA;comp2&amp;#xA;sig44: 0"&gt;comp1 1 1 Time1 comp2 0 Time2&lt;/td&gt;
</code></pre>

<p>I tried using <code>replace($faultDetails, ' (\d) ', ': $1&amp;#xA;')</code> but found out that <code>$faultDetails</code> actually is a sequence of strings without spaces, whereas replace only operates on a contiguous string. As I write this I realize that I can get almost there with this:</p>

<pre><code>&lt;xsl:value-of select="fault/@componentName | fault/signals/signal/@name | 
                      fault/signals/signal/@value" separator="&amp;#xA;"/&gt;
</code></pre>

<p>Any tips on how to do this?</p>