title: C# XML tags to csv
body: <p>I have dozend of XML filed in the following format (short sample):</p>
  
  <pre><code>&lt;namespace name="Colors"&gt;
      &lt;green&gt;
          &lt;en&gt;Green&lt;/en&gt;
          &lt;de&gt;Gruen&lt;/de&gt;
      &lt;/green&gt;
      &lt;blue&gt;
          &lt;en&gt;Blue&lt;/en&gt;
          &lt;de&gt;Blau&lt;/de&gt;
      &lt;/blue&gt;
      &lt;namespace name="Subcolors"&gt;
          &lt;perlwhite&gt;
              &lt;en&gt;Perl White&lt;/en&gt;
              &lt;de&gt;Perlweis&lt;/de&gt;
          &lt;/perlwhite&gt;
          &lt;racingblack&gt;
              &lt;en&gt;Racing Black&lt;/en&gt;
              &lt;de&gt;Rennschwarz&lt;/de&gt;
          &lt;/racingblack&gt;
      &lt;/namespace&gt;
  &lt;/namespace&gt;
  </code></pre>
  
  <p>And i have to extract all the language tags and output them into a csv file in this format:</p>
  
  <pre><code>en;de;
  Green;Gruen;
  Blue;Blau;
  Perl White;Perlweiß;
  Racing Black;Renn Schwarz;
  </code></pre>
  
  <p>Then, I give this CSV file away for translation. After translation, there is a new language added to the CSV file, french for example:</p>
  
  <pre><code>en;de;fr;
  Green;Gruen;Vert;
  Blue;Blau;Bleu;
  Perl White;Perlweiß;Perl Blanc;
  Racing Black;Rennschwarz;Courses Noir;
  </code></pre>
  
  <p>Then i need to read this csv file in again, and append all  tags to all the corresponding  xml-files, like so:</p>
  
  <pre><code>&lt;namespace name="Colors"&gt;
      &lt;green&gt;
          &lt;en&gt;Green&lt;/en&gt;
          &lt;de&gt;Gruen&lt;/de&gt;
          &lt;fr&gt;Vert&lt;/fr&gt;
      &lt;/green&gt;
      &lt;blue&gt;
          &lt;en&gt;Blue&lt;/en&gt;
          &lt;de&gt;Blau&lt;/de&gt;
          &lt;fr&gt;Bleu&lt;/fr&gt;
      &lt;/blue&gt;
      &lt;namespace name="Subcolors"&gt;
          &lt;perlwhite&gt;
              &lt;en&gt;Perl White&lt;/en&gt;
              &lt;de&gt;Perlweis&lt;/de&gt;
              &lt;fr&gt;Perl Blanc&lt;/fr&gt;
          &lt;/perlwhite&gt;
          &lt;racingblack&gt;
              &lt;en&gt;Racing Black&lt;/en&gt;
              &lt;de&gt;Renn Schwarz&lt;/de&gt;
              &lt;fr&gt;Courses Noir&lt;/fr&gt;
          &lt;/racingblack&gt;
      &lt;/namespace&gt;
  &lt;/namespace&gt;
  </code></pre>
  
  <p>And namespaces or other nodes(not listed here, like "multicolor", "colored" and many more) can be nested more then once. Not every file contains every node. And not every node is nested the same way in each xml file. Thats different from file to file. But at the end, each branch ends with couple of language tags. And these need to be read and updated.</p>
  
  <p>So an xml file can look like this:</p>
  
  <pre><code>&lt;namespace name="Colors"&gt;
      &lt;green&gt;
          &lt;en&gt;Green&lt;/en&gt;
          &lt;de&gt;Gruen&lt;/de&gt;
      &lt;/green&gt;
      &lt;blue&gt;
          &lt;en&gt;Blue&lt;/en&gt;
          &lt;de&gt;Blau&lt;/de&gt;
      &lt;/blue&gt;
          &lt;namespace name="Subcolors"&gt;
              &lt;perlwhite&gt;
                  &lt;en&gt;Perl White&lt;/en&gt;
                  &lt;de&gt;Perlweis&lt;/de&gt;
              &lt;/perlwhite&gt;
              &lt;racingblack&gt;
                  &lt;en&gt;Racing Black&lt;/en&gt;
                  &lt;de&gt;Rennschwarz&lt;/de&gt;
              &lt;/racingblack&gt;
              &lt;colored&gt;
                  &lt;namespace name="Misc"&gt;
                      &lt;fruits&gt;
                          &lt;apple&gt;
                              &lt;de&gt;Apfel&lt;/de&gt;
                              &lt;en&gt;Apple&lt;/en&gt;
                          &lt;/apple&gt;
                          &lt;orange&gt;
                              &lt;de&gt;Orange&lt;/de&gt;
                              &lt;en&gt;Orange&lt;/en&gt;
                          &lt;/orange&gt;
                      &lt;/fruits&gt;
                      &lt;vegetables&gt;
                          &lt;cucumber&gt;
                              &lt;en&gt;Cucumber&lt;/en&gt;
                              &lt;de&gt;Gurke&lt;/de&gt;
                          &lt;/cucumber&gt;
                      &lt;/vegetables&gt;
                      &lt;namespace name="Other"&gt;
                          &lt;othertag&gt;
                              &lt;entry&gt;
                                  &lt;en&gt;Entry&lt;/en&gt;
                                  &lt;de&gt;Eintrag&lt;/de&gt;
                              &lt;/entry&gt;
                          &lt;/othertag&gt;
                      &lt;/namespace&gt;
                  &lt;/namespace&gt;
              &lt;/colored&gt;
          &lt;/namespace&gt;
      &lt;/namespace&gt;
  </code></pre>
  
  <p>So not every xml file is the same, and there are different nodes with different tag names differenty nested. But every branch ends with language tags.</p>
  
  <p>Can somebody help me to do this in a simple way with C#?. Maybe two simple functions like Import(readCsvPath, appendXmlPath) and Export(readXmLPath, writeCsvPath).</p>