title: Java: String.replace(regex, string) to remove content from XML
body: <p>Lets say I have an XML in the form of a string. I wish to remove the content between two tags within the XML String, say . I have tried:</p>
  
  <pre><code>String newString = oldString.replaceFirst("\\&lt;tagName&gt;.*?\\&lt;//tagName&gt;",
                                                                "Content Removed");
  </code></pre>
  
  <p>but it does not work. Any pointers as to what am I doing wrong?</p>