title: Formatting XElement with tabs
body: <p>I have an existing xml document:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;property_set_list&gt;
      &lt;property_set symbol_id="TestPropertySet1"&gt;
          &lt;property symbol_id="TestName1" id="1" type="8"&gt;Test&lt;/property&gt;
          &lt;property symbol_id="TestName2" id="2" type="8"&gt;&lt;/property&gt;
      &lt;/property_set&gt;
      &lt;property_set symbol_id="TestPropertySet2"&gt;
  
      &lt;/property_set&gt;
  &lt;/property_set_list&gt;
  </code></pre>
  
  <p>I load it and update and add some properties. For example:</p>
  
  <p>TestName1 property is updated.
   TestName 2 property stays as it is.</p>
  
  <p>In the TestPropertySet2 I am adding some new properties.</p>
  
  <p>The output of the document after all the manipulation is the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;property_set_list&gt;
      &lt;property_set symbol_id="TestPropertySet1"&gt;
          &lt;property symbol_id="TestName1" id="1" type="8"&gt;qwerty&lt;/property&gt;
          &lt;property symbol_id="TestName2" id="1" type="8"&gt;
          &lt;/property&gt;
      &lt;/property_set&gt;
      &lt;property_set symbol_id="TestPropertySet2"&gt;
          &lt;property symbol_id="localeID" id="1" type="19"&gt;1033&lt;/property&gt;
          &lt;property symbol_id="localeID" id="2" type="19"&gt;1079&lt;/property&gt;
      &lt;/property_set&gt;
  &lt;/property_set_list&gt;
  </code></pre>
  
  <p>This is the code I used for loading and manipulating the document:</p>
  
  <pre><code>using (var reader = ReaderCreator())
              using (var output = OutputCreator())
              using (var xmlWriter = new XmlTextWriter(output))
              {
                  xmlWriter.Indentation = 1;
                  xmlWriter.Formatting = Formatting.Indented;
                  xmlWriter.IndentChar = TAB;
  
                  XDoc = XElement.Load(reader, LoadOptions.None);
                  Namespace = "some namespace";
  
                 // some code to update properties
  
  
                  // adds new nodes to TestPropertySet2
                  foreach (var localeId in _franchise.LocaleIds)
                  {
                      TestPropertySet2.Add(
                          new XElement(
                              Namespace + "property", localeId,
                              new XAttribute("symbol_id", "localeID"),
                              new XAttribute("id", i),
                              new XAttribute("type", "19")
                          )
                      );
                      i++;
                  }
  
                  XDoc.Save(xmlWriter);
              }
  </code></pre>
  
  <p>The problem is TestName2 property is on two rows now:</p>
  
  <pre><code>&lt;property symbol_id="TestName2" id="1" type="8"&gt;
              &lt;/property&gt;
  </code></pre>