title: Avoid the carriage return when writing InnerText in xml elements using System.Xml.XmlWriter
body: <p>I'm using XmlWriter to save an XmlDocument in .Net. However all the elements that have InnerText are written with surrounding carriage return characters.</p>
  
  <p>I tried using XmlWriterSettings to avoid the writing of those characters, but no luck yet.</p>
  
  <p>Here it is a piece of code used:</p>
  
  <pre><code>        XmlDocument outXml = new XmlDocument();
          outXml.AppendChild .......
          XmlWriterSettings sets = new XmlWriterSettings();
          sets.Encoding = encoding;
          sets.Indent = true;
          XmlWriter xwriter = XmlWriter.Create(file, sets);
          outXml.Save(xwriter);
          xwriter.Close();
  </code></pre>
  
  <p>The xml output is like:</p>
  
  <pre><code>  &lt;String Id="msierrXmlFileFailedSave" Overridable="yes"&gt;
      Fehler beim Speichern der Einstellungen-Datei.
    &lt;/String&gt;
  </code></pre>
  
  <p>The xml output needed should be like:</p>
  
  <pre><code>  &lt;String Id="msierrXmlFileFailedSave" Overridable="yes"&gt;Fehler beim Speichern der Einstellungen-Datei.&lt;/String&gt;
  </code></pre>
  
  <p>Is there a way to avoid the writing of those carriage returns inside the elements?</p>
  
  <p>PD: I saw an <a href="https://stackoverflow.com/questions/1276243/carriage-return-in-xmlnode-innertext">opposite question</a> about this issue, but the solution does not apply to this case.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Allan.c</p>