title: Find and adjust date and timestamp in XML using python
body: <p>I'm trying to change all date values in an XML and subsequently add or subtract an user specified amount of time from the time stamps.</p>
  
  <p>The timestamps are all of the format 2016-06-29T17:03:39.000Z
  However, they are not all enclosed in the same tags</p>
  
  <p>My XML looks something like this:</p>
  
  <pre><code>&lt;Id&gt;2016-06-29T17:03:37.000Z&lt;/Id&gt;
  &lt;Lap StartTime="2016-06-29T17:03:37.000Z"&gt;
  &lt;TotalTimeSeconds&gt;6906&lt;/TotalTimeSeconds&gt;
  &lt;DistanceMeters&gt;60870.5&lt;/DistanceMeters&gt;
  &lt;Intensity&gt;Active&lt;/Intensity&gt;
  &lt;TriggerMethod&gt;Manual&lt;/TriggerMethod&gt;
  &lt;Track&gt;
  &lt;Trackpoint&gt;
  &lt;Time&gt;2016-06-29T17:03:37.000Z&lt;/Time&gt;
  </code></pre>
  
  <p>I want to run through the XML file row by row, and search for the date/time string, then first find and replace the date, secondly add/subtract some amount of time from the timestamp.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>import re
  import xml.etree.ElementTree as et
  
  name_file = 'test.txt' 
  fh = open(name_file, "r")
  filedata = fh.read()
  fh.close()
  
  filedata = filedata.split()
  for line  in filedata:
      cur_date = re.findall('\d{4}[-/]\d{2}[-/]\d{2}', line)
      print cur_date
  </code></pre>
  
  <p>Does anyone have an idea on how to do this?</p>