title: Add tag to xml filed in oracle (transform xml)
body: <p>I have table with filed "XmlInfo". This field is a varchar2 and contain XML.
  Don't ask why it is varchar2 - this is old database structure.</p>
  
  <p>I need to "add" one tag in this xml.
  So I used xmltype.createXML and APPENDCHILDXML combination. Problem is with output.</p>
  
  <p>Original field is without indent. So first I use xmlserialize with "no indent" option. Unfortunately this is available only in oracle 11, and I need to this query work on both 10 and 11 oracle.</p>
  
  <p>So I use transform. But again I'm stuck.</p>
  
  <p><strong>Original value:</strong></p>
  
  <pre><code>&lt;info&gt;&lt;Managed&gt;False&lt;/Managed&gt;&lt;/info&gt;
  </code></pre>
  
  <p><strong>Expected:</strong></p>
  
  <pre><code>&lt;info&gt;&lt;Managed&gt;False&lt;/Managed&gt;&lt;ChangedDate&gt;2013-09-11&lt;/ChangedDate&gt;&lt;/info&gt;
  </code></pre>
  
  <p><br />
  I use this query</p>
  
  <pre><code>select xmltype.createXML(t1.XmlInfo).APPENDCHILDXML('//info',XMLTYPE.CREATEXML('&lt;ChangedDate&gt;'|| to_char(sysdate, 'yyyy-mm-dd') ||'&lt;/ChangedDate&gt;'))
    .transform(xmltype(
      '&lt;?xml version="1.0"?&gt;&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;&lt;xsl:output omit-xml-declaration="yes" indent="no"/&gt;&lt;xsl:template match="@*|node()"&gt;&lt;xsl:copy&gt;&lt;xsl:apply-templates select="@*|node()"/&gt;&lt;/xsl:copy&gt;&lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;'
    )).getStringVal()
  from table1 t1
  </code></pre>
  
  <p><strong>Result in Oracle 11 (as expected):</strong></p>
  
  <pre><code>&lt;info&gt;&lt;Managed&gt;False&lt;/Managed&gt;&lt;ChangedDate&gt;2013-09-11&lt;/ChangedDate&gt;&lt;/info&gt;
  </code></pre>
  
  <p><strong>Result in Oracle 10 (there is new line char):</strong></p>
  
  <pre><code>&lt;info&gt;
  &lt;Managed&gt;False&lt;/Managed&gt;
  &lt;ChangedDate&gt;2013-09-11&lt;/ChangedDate&gt;
  &lt;/info&gt;
  </code></pre>
  
  <p><br /><br />
  What is wrong with this transform, or is there any way to write this query and work as expected in both version of oracle?</p>
  
  <p>Remarks:
  In next step I'll have to update this value, so I'll use "updatexml". This is why I cannot just concatenate two string.</p>