title: sed replace xml tag
body: <p>I want to replace value inside a tag in an xml file using sed.</p>
  
  <pre><code>&lt;version&gt; xxxx-SS &lt;/version&gt;
  </code></pre>
  
  <p>I want to replace xxxx-SS with some shell variable $ver .
  The final result should be</p>
  
  <pre><code>&lt;version&gt;$ver&lt;/version&gt;
  </code></pre>
  
  <p>The sed command should also quit after replacing the first instance.</p>
  
  <p>So far I have been able to only append to the xxxx-SS and not been able to quit after the first match.</p>
  
  <pre><code>sed 's#\(&lt;version&gt;\)*\(&lt;/version&gt;\)#\1'$ver'\2#g' test.xml
  </code></pre>
  
  <p>This only appends the value between -SNAPSHOT tag.Basically makes it xxxx-SS$ver</p>