title: add XML node with formatting
body: <p>I am adding a node to the XML file, but I need it to be properly formatted. Could you assist with it?</p>
  
  <pre><code>        String newFile = System.IO.Path.GetFileName(textBox1.Text);
  
          //file name
          string filename = @"palette.xml";
          XmlDocument doc = new XmlDocument();
          doc.Load(filename);
  
          //create node and add value
          XmlNode node = doc.CreateNode(XmlNodeType.Element, "item", null);
  
          //create title node
          XmlNode nodeTitle = doc.CreateElement("name");
          //add value for it
          nodeTitle.InnerText = @"&lt;![CDATA["+newFile+"]]&gt;";
  
          //create Url node
          XmlNode nodeUrl = doc.CreateElement("imgfile");
          nodeUrl.InnerText = newFile;
  
          //add to parent node
          node.AppendChild(nodeTitle);
          node.AppendChild(nodeUrl);
  
          //add to elements collection
          doc.DocumentElement.AppendChild(node);
  
          //save back
          doc.Save(filename);
  </code></pre>
  
  <p>The XML should be looking like that:</p>
  
  <pre><code>  &lt;item&gt;
    &lt;name&gt;&lt;![CDATA[panda.gif]]&gt;&lt;/name&gt;
    &lt;imgfile&gt;panda.gif&lt;/imgfile&gt;
    &lt;/item&gt;
  </code></pre>
  
  <p>but it look like that:</p>
  
  <pre><code>  &lt;item&gt;
    &lt;name&gt;&amp;lt;![CDATA[panda.gif]]&amp;gt;&lt;/name&gt;
    &lt;imgfile&gt;panda.gif&lt;/imgfile&gt;
    &lt;/item&gt;
  </code></pre>