title: Extract Tags from a html file using Jsoup
body: <p>I am doing a structural analysis on web documents. For this i need to extract only the structure of a web document(only the tags). I found a html parser for java called Jsoup. But I don't know how to use it to extract tags.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;html&gt;
   &lt;head&gt;
      this is head
   &lt;/head&gt;
   &lt;body&gt;
      this is body
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>html,head,head,body,body,html
  </code></pre>