title: How to delete a line containing pattern which is first found after a specific pattern
body: <p>I am writting a shell script to delete an entry from a specific group. eg: file name is dest.xml</p>
  
  <pre><code>&lt;domain id="1" group_name="group1"&gt;
      &lt;node id="ABC"&gt;
      &lt;node id="PQR"&gt;
      &lt;node id="XYZ"&gt;
  &lt;/domain&gt;
  &lt;domain id="2" group_name="group2"&gt;
      &lt;node id="PQR"&gt;
      &lt;node id="XYZ"&gt;
  &lt;/domain&gt;
  &lt;domain id="3" group_name="group3"&gt;
      &lt;node id="ABC"&gt;
      &lt;node id="PQR"&gt;
   &lt;/domain&gt;
  </code></pre>
  
  <p>I want to delete an entry from above file (filename is dest.xml) with node id="PQR" from group_name="group1" (it should not get deleted from group2 and group3). I can do it by reading a file sequentially n then delete it from a specific group. But if the file is to large (>10k lines) then it takes time.</p>
  
  <p>Is there any simple way to this this?</p>