title: Extract xml tags from xml String
body: <p>I am working in an web application. In my project I am using xml for dynamic UI generations. I have an xml which i want to transform that into xsl so that i can use that for UI.
  My question is,</p>
  
  <p>I have an xml string,How can i do the following?</p>
  
  <p>from these xml string,</p>
  
  <pre><code>&lt;editor_tab label="Editor"&gt;
          &lt;attributes&gt;
              &lt;attribute sequenceNo="12" dataType="string" controltype="Editor"
                  name="additional_info" UILabel="Notes" mandatory="N" default="NA"
                  updatable="Y" viewable="Y" attribute_id="END12" /&gt;
          &lt;/attributes&gt;
      &lt;/editor_tab&gt;
      &lt;document_tab label="Document"&gt;
          &lt;attributes&gt;
              &lt;attributePair displayName="Entity Attributes" name="FileSet1"
                  class="entityAttr"&gt;
                  &lt;attribute sequenceNo="1" dataType="string" controltype="TD"
                      name="Filename" UILabel="" attribute_id="END407" /&gt;
                  &lt;attribute sequenceNo="2" dataType="string" controltype="Hidden"
                      name="FileBytestream" UILabel="" attribute_id="END408" /&gt;
                  &lt;attribute sequenceNo="3" dataType="string" controltype="Hidden"
                      name="AllowedType" UILabel="" attribute_id="END409" /&gt;
                  &lt;attribute sequenceNo="4" dataType="string" controltype="Hidden"
                      name="AllowedMaxSize" UILabel="" attribute_id="END410" /&gt;
              &lt;/attributePair&gt;
  </code></pre>
  
  <p></p>
  
  <p>i have to extract as separate xml like,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;editor_tab label="Editor"&gt;
          &lt;attributes&gt;
              &lt;attribute sequenceNo="12" dataType="string" controltype="Editor"
                  name="additional_info" UILabel="Notes" mandatory="N" default="NA"
                  updatable="Y" viewable="Y" attribute_id="END12" /&gt;
          &lt;/attributes&gt;
      &lt;/editor_tab&gt;
  </code></pre>
  
  <p>I am using DOM parser for xml parsing.</p>