title: Replace text in XML multi line tags using sed
body: <p>I am new to sed and having trouble finding and replacing multiline XML code between the XML tags by some XML code. Here is the sample for XML code</p>
  
  <pre><code> &lt;List&gt;
     &lt;User&gt;
        &lt;Id&gt;1234&lt;/Id&gt;
           &lt;Info&gt;
              &lt;Id&gt;11&lt;/Id&gt;
           &lt;/Info&gt;
      &lt;/User&gt;
   &lt;/List&gt;
  </code></pre>
  
  <p>I want to replace the XMl code between List tags to become ..</p>
  
  <pre><code>&lt;List&gt;
     &lt;Replace&gt;
       &lt;Id&gt; 223 &lt;Id&gt;
     &lt;/Replace&gt;
   &lt;/List&gt;
  </code></pre>
  
  <p>I used 
  <code>sed "s/\(&lt;Id&gt;\).*\(&lt;\/Id\)/\19999\2/" input.xml &gt; output.xml</code> but its working for single line but not for multi line. The content between List tags may change and also it can be inline.. so cannot reply upon particular pattern but need to rely on just tags. Any help or pointers would be appreciated?</p>