title: How to avoid surrounding html head tags in Jsoup parse
body: <p>Using Jsoup i try to parse the given html content. After Jsoup.parse() the html output append html, head and body tag to the input. I just want to ignore these.</p>
  
  <p><strong>Sample Input:</strong></p>
  
  <pre><code>&lt;p&gt;&lt;b&gt;This &lt;i&gt;is&lt;/i&gt;&lt;/b&gt; &lt;i&gt;my sentence&lt;/i&gt; of text.&lt;/p&gt;
  </code></pre>
  
  <p>Java code:</p>
  
  <pre><code>import java.io.File;
  import java.io.IOException;
  
  import org.apache.commons.io.FileUtils;
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.jsoup.nodes.Element;
  import org.jsoup.select.Elements;
  
  public class HTMLParse {
  
      public static void main(String args[]) throws IOException {
          try{
              File input = new File("/ab.html");
              String html = FileUtils.readFileToString(input, null);
  
              Document doc = Jsoup.parseBodyFragment(html);
              doc.outputSettings().prettyPrint(false);
              System.out.println(doc.html());
          }
          catch(Exception e){
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p><strong>Actual output:</strong></p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;&lt;b&gt;This &lt;i&gt;is&lt;/i&gt;&lt;/b&gt; &lt;i&gt;my sentence&lt;/i&gt; of text.&lt;/p&gt;
      &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p><strong>Expected Output:</strong></p>
  
  <pre><code>&lt;p&gt;&lt;b&gt;This &lt;i&gt;is&lt;/i&gt;&lt;/b&gt; &lt;i&gt;my sentence&lt;/i&gt; of text.&lt;/p&gt;
  </code></pre>
  
  <p>Please help.</p>