title: remove nested element using regular expression
body: <p>I am new to regex.  I want to only capture the text portion from <code>&lt;firstpar&gt;</code> or to remove all <code>&lt;asmbly&gt;</code> with all its children nodes and values.  Can anyone show me how to do that. The following is the snap shot of the xml fiel.  thanks.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;firstpar&gt;
      &lt;thumbcred&gt;Sample 1 thumbcred&lt;/thumbcred&gt;
      &lt;asmbly&gt;
         &lt;caption&gt;
             &lt;p&gt;&lt;work ty="drawing"&gt;Two Fabulous Animals&lt;/work&gt;Sample 1 &lt;e&gt; sample 1caption &lt;/e&gt;&lt;/p&gt;
          &lt;/caption&gt;
          &lt;credit&gt;Paul Miller/AP&lt;/credit&gt;
          &lt;asset id="126099" hgt="450" wdth="289" tmstp="24-OCT-08"
              bintype="2" filename="images/sample126099.jpg" source="eb" bighgt="1600"
              bigwdth="1029" bigfilename="botany003.jpg"
              bigdeployfullfilename="/eb-media/99/126099-050-CAD1EF0A.jpg"
          /&gt;
  
          &lt;copyright&gt;Copyright © 1994-2013 Encyclopædia Britannica,  Inc.&lt;/copyright&gt;
      &lt;/asmbly&gt;
  
  Sample firstpar text &lt;e&gt;Sample e&lt;/e&gt; just some
  text &lt;sub&gt;sample sub &lt;/sub&gt;&lt;e&gt;sample e text again&lt;/e&gt; more text with sup sub e. 
  
      &lt;/firstpar&gt;
  </code></pre>