title: How to remove line breaks in xml text nodes
body: <p>Let's say I've very badly formatted XML like:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
  &lt;tag1&gt;
    &lt;tag2&gt;
         Some text
    &lt;/tag2&gt;
    &lt;tag3&gt;
         Some other text
    &lt;/tag3&gt;
  &lt;/tag1&gt;
  </code></pre>
  <p>I've to transform it to form like:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
  &lt;tag1&gt;
    &lt;tag2&gt;roman&lt;/tag2&gt;
    &lt;tag3&gt;Some other text&lt;/tag3&gt;
  &lt;/tag1&gt;
  </code></pre>
  <p>I've tried to use XSLT transformation like this (also in many variants):</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;
  &lt;xsl:template match=&quot;text()&quot;&gt;
      &lt;xsl:value-of select=&quot;normalize-space(.)&quot; /&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match=&quot;node()|@*&quot;&gt;
    &lt;xsl:copy&gt;&lt;xsl:apply-templates select=&quot;node()|@*&quot;/&gt;&lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>I've used <a href="https://xslttest.appspot.com/" rel="nofollow noreferrer">this online tool</a> to verify but I always fail...</p>
  <p>Could you help me what's the easiest way to do this?</p>