title: Reading XML with unclosed tags in C#
body: <p>I have a program which runs tests and generates a grid-view with all the results in it, and also an XML log file. The program also has the functionality to load logs to replicate the grid-view. </p>
  
  <p>Since the program writes to the log file as its executing, if it crashes the log file will be missing closing tags. I still want to be able to load these XML files though as there is still lots of valuable data that can help me find out what caused the crash.</p>
  
  <p>I was thinking maybe going through the XML file and closing off any unclosed XML tag, or maybe writing some kind of "Dirty" XML reader that would pretend every tag was closed. Any ideas on what I could do or how I should proceed?</p>
  
  <p>Edit: </p>
  
  <pre><code>&lt;Root&gt;
    &lt;Parent&gt;
       &lt;Child Name="One"&gt;
          &lt;Foo&gt;...&lt;/Foo&gt;
          &lt;Bar&gt;...&lt;/Bar&gt;
          &lt;Baz&gt;...&lt;/Baz&gt;
       &lt;/Child&gt;
       &lt;Child Name="Two"&gt;
          &lt;Foo&gt;...&lt;/Foo&gt;
          &lt;Bar&gt;...&lt;/Bar&gt;
   !-- Crash happens here --!
  </code></pre>
  
  <p>From this I would still look to produce</p>
  
  <pre><code> Child   Foo   Bar   Baz
   One     ...   ...   ...
   Two     ...   ...    /
  </code></pre>