title: Using sed to delete node and data from XML file
body: <p>I am trying to clean up an XML file using sed.</p>
  
  <p>I need to remove all <code>&lt;DistanceMeters&gt;123.123&lt;/DistanceMeters&gt;</code>.</p>
  
  <p>I've been trying to use this command, without success:</p>
  
  <pre><code>sed 's/(&lt;DistanceMeters&gt;)[.]*?(&lt;\/DistanceMeters&gt;)/ /g' file.txc
  </code></pre>
  
  <p>Example node:</p>
  
  <pre><code>&lt;Trackpoint&gt;&lt;Time&gt;2014-02-12T18:18:49+11:00&lt;/Time&gt;
  &lt;Position&gt;&lt;LatitudeDegrees&gt;35.209656&lt;/LatitudeDegrees&gt;&lt;LongitudeDegrees&gt;28.99924&lt;/LongitudeDegrees&gt;&lt;/Position&gt;
  &lt;AltitudeMeters&gt;586.99994&lt;/AltitudeMeters&gt;
  &lt;DistanceMeters&gt;148.30713&lt;/DistanceMeters&gt;
  &lt;Cadence&gt;4&lt;/Cadence&gt;
  &lt;Extensions&gt;&lt;TPX xmlns="http://www.garmin.com/xmlschemas/ActivityExtension/v2" CadenceSensor="Bike"&gt;&lt;Speed&gt;0.043145742&lt;/Speed&gt;&lt;/TPX&gt;&lt;/Extensions&gt;&lt;/Trackpoint&gt;
  </code></pre>
  
  <p>To make things a little more confusing, the source file is all on a single line.</p>
  
  <p>Thanks.</p>