title: Unix XML file convert into Flat file
body: <p>We are having multiple xml files on unix. We need to convert them into flat files. And we did that parsing for one level of xml file using C (C was used as C can communicate with Teradata fastload which is our target box using inmod and it will complete within one parse other wise in other languages we need to do two times parsing one for converting into flat file and one for loading ito teradata). i.e. the below file </p>
  
  <pre><code>&lt;book id="bk101"&gt;
        &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
        &lt;title&gt;XML Developer's Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;44.95&lt;/price&gt;
     &lt;/book&gt;
  </code></pre>
  
  <p>Is converted into </p>
  
  <pre><code>bk101~Gambardella, Matthew~XML Developer's Guide~Computer~44.95~
  </code></pre>
  
  <p>This we achieved by parsing the file in C. But after seeing the original format of xml file which is below. (Please do not consider it as the required file. I am just giving an idea)</p>
  
  <pre><code>&lt;book id="bk101"&gt;
        &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
        &lt;title&gt;XML Developer's Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
               &lt;modified&gt;2010-01-02&lt;/modified&gt;
               &lt;modified&gt;2010-01-03&lt;/modified&gt;
        &lt;price&gt;44.95&lt;/price&gt;
     &lt;/book&gt;
  </code></pre>
  
  <p>This should be converted to two records it seems.</p>
  
  <pre><code>bk101~Gambardella, Matthew~XML Developer's Guide~Computer~2010-01-02~44.95~
  bk101~Gambardella, Matthew~XML Developer's Guide~Computer~2010-01-03~44.95~
  </code></pre>
  
  <p>But now we are feeling that our C code is going to be complex for this req. So we are looking at other options which can be easily used on unix. Can any one please give us any working example codes in different languages/options for unix?</p>