title: Java regex to strip out XML tags, but not tag contents
body: <p>I have the following Java code:</p>
  
  <pre><code>str = str.replaceAll("&lt;.*?&gt;.*?&lt;/.*?&gt;|&lt;.*?/&gt;", "");
  </code></pre>
  
  <p>This turns a String like so:</p>
  
  <pre><code>How now &lt;fizz&gt;brown&lt;/fizz&gt; cow.
  </code></pre>
  
  <p>Into:</p>
  
  <pre><code>How now  cow.
  </code></pre>
  
  <p>However, I want it to just strip the <code>&lt;fizz&gt;</code> and <code>&lt;/fizz&gt;</code> tags, or just standalone <code>&lt;/fizz</code>> tags, and leave the element's content alone. So, a regex that would turn the above into:</p>
  
  <pre><code>How now brown cow.
  </code></pre>
  
  <p>Or, using a more complex String, somethng that turns:</p>
  
  <pre><code>How &lt;buzz&gt;now &lt;fizz&gt;brown&lt;/fizz&gt;&lt;yoda/&gt;&lt;/buzz&gt; cow.
  </code></pre>
  
  <p>Into:</p>
  
  <pre><code>How now brown cow.
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>str = str.replaceAll("&lt;.*?&gt;&lt;/.*?&gt;|&lt;.*?/&gt;", "");
  </code></pre>
  
  <p>And that doesn't work at all. Any ideas? Thanks in advance!</p>