title: Reading XML file leaving possible new lines
body: <p>I am using ElementTree to read an .xml file and save the output to a .csv file. I loop over all of the lines in the xml file and save the name and text pairs in a list.</p>
  
  <pre><code>savedParameters = []
  
  tree = ET.parse(work_dir + input_name)
  root = tree.getroot()
  
  for child in root:
      savedParameters.append({'parameterName' : child.tag, 'Value' : child.text})
      for gchild in child:
          savedParameters.append({'parameterName' : gchild.tag, 'Value' : gchild.text})
          for ggchild in gchild:
          .
          .
          .
  </code></pre>
  
  <p>I then loop over the savedParameters and write them to a csv file. This all works fine apart from in one situation, take the example from the xml below.</p>
  
  <pre><code>&lt;VehicleId&gt;123456789&lt;/VehicleId&gt;
  -&lt;VRMs&gt;
      &lt;ForAppointment&gt;X111XXX&lt;/ForAppointment&gt;
      &lt;Alternate&gt;X111XXX&lt;/Alternate&gt;
  &lt;/VRMs&gt;
  &lt;Vin&gt;123456&lt;/Vin&gt;
  </code></pre>
  
  <p>In this case everything will be stored as expected apart from the  field. This field should be empty however when I access child.text() it stores a blank string with a new line i.e all of the spaces between <code>-&lt;VRMs&gt;</code> and <code>&lt;/VRMs&gt;</code>. Therefore when I write out to the csv it writes out the new line. </p>
  
  <p>I have tried <code>replace(" ", "")</code> and <code>replace("\n","")</code> but neither solve my problem. Does anyone know a way around this?</p>