title: Is there any use for putting a string that contains enters (char 10 or 13) in a xml CDATA section?
body: <p>I'm currently working on some old code that has the following construct.</p>
  
  <pre><code>Document doc = org.w3c.Document
  Element root = doc.getDocumentElement();
  
  if ( string contains \n or \r )
  then
    root.appendChild(doc.createCDATASection(string))
  else
    root.appendChild(doc.createTextNode(string))
  endif  
  </code></pre>
  
  <p>I can not think of any usage that would need to put a string a CDATA section when it contains an "\n" or an "\r". I believe using createTextNode will not cause any trimming or removal of newlines in the text in case string is like "mytext\n\n\n" when you either set it or retrieve the value.</p>
  
  <p>Can somebody think of a valid/usefull case where you would want to put such a string in a CDATA section? </p>