title: Parsing a text file with multiple tags and writing it to another text file
body: <p>Need to read a text file which looks like an XML.The text file comprises of  multiple XML files  ,with a parent tags  .Need to parse the file and line by line and need to write the corresponding elements of the required  child tags even  repeated multiple times within  the parent tag , in a single line, to another text file .Need to write the elements to a next line after the parent tag.I know how to read a file and write the file ,But I am unable to get the logic to read it acording to the requirement .Please help me out .</p>
  
  <pre><code>    &lt;parentnode xmlns="http://www.fpml.org/FpML-5/recordkeeping" fpmlVersion="5-5" xmlns:abcde="http://www.abcde.com/ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abcde.com/ext /../xmls/XYZ/recordkeeping/abcde-ext.xsd"&gt;
  &lt;Child1 Child1Scheme="http://www.google.com"&gt;1234566546&lt;/Child1&gt;
  &lt;Child1 Child1Scheme="http://www.fpml.org/coding-scheme/external/UNique"&gt;AbcdeXYZ-23243423&lt;/Child1&gt;
  &lt;country countryScheme="http://www.fpml.org/coding-scheme/external/country-identifier"&gt;1030253498&lt;/country&gt;
  &lt;state stateScheme="http://www.fpml.org/coding-scheme/external/state-identifier"&gt;23423423423&lt;/state&gt;
  &lt;/parentnode&gt;
  
  &lt;parentnode xmlns="http://www.fpml.org/FpML-5/recordkeeping" fpmlVersion="5-5" xmlns:abcde="http://www.abcde.com/ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abcde.com/ext /../xmls/XYZ/recordkeeping/abcde-ext.xsd"&gt;
  &lt;Child1 Child1Scheme="http://www.google.com"&gt;1234566546&lt;/Child1&gt;
  &lt;Child1 Child1Scheme="http://www.fpml.org/coding-scheme/external/UNique"&gt;AbcdeXYZ-154555&lt;/Child1&gt;
  &lt;country countryScheme="http://www.fpml.org/coding-scheme/external/country-identifier"&gt;1030253498&lt;/country&gt;
  &lt;state stateScheme="http://www.fpml.org/coding-scheme/external/state-identifier"&gt;434343242&lt;/state&gt;
  &lt;/parentnode&gt;
  
  &lt;parentnode xmlns="http://www.fpml.org/FpML-5/recordkeeping" fpmlVersion="5-5" xmlns:abcde="http://www.abcde.com/ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abcde.com/ext /../xmls/XYZ/recordkeeping/abcde-ext.xsd"&gt;
  &lt;Child1 Child1Scheme="http://www.google.com"&gt;1234566546&lt;/Child1&gt;
  &lt;Child1 Child1Scheme="http://www.fpml.org/coding-scheme/external/UNique"&gt;AbcdeXYZ-4566545&lt;/Child1&gt;
  &lt;country countryScheme="http://www.fpml.org/coding-scheme/external/country-identifier"&gt;1030253498&lt;/country&gt;
  &lt;state stateScheme="http://www.fpml.org/coding-scheme/external/state-identifier"&gt;2323232323&lt;/state&gt;
  &lt;/parentnode&gt;
  </code></pre>