And I'm back :P . You just parse the html that you have again so jsoup will remove any extra closing tags
String url = request.getParameter("htmluri").trim();
System.out.println("Fetching %s..."+url);
Document doc = Jsoup.connect(url).get();
Document.OutputSettings settings = doc.outputSettings();
settings.prettyPrint(false);
settings.charset("ASCII");
String html = doc.html();
html = StringEscapeUtils.unescapeHtml(html);
html = Jsoup.parse(html).html(); //This will take care of any extra closing tags
System.out.println(html);
Output
Fetching %s...http://iqtestsites.adtech.de/pictelatest/custombkgd/StylelistDevil.html
<!DOCTYPE html>
<html xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="SAF" id="global-header-light">
<head>
<style>
</style>
</head>
<body>
<div style="background-image: url(http://iqtestsites.adtech.de/pictelatest/custombkgd/StylelistDevil.jpg); background-repeat: no-repeat;-webkit-background-size: 1001px 1903px;height: 1903px; width: 1001px; text-align: center; margin: 0 auto;">
<div style="height:1050px; width:300px; padding-left:681px; padding-top:200px;">
<iframe style="height:1050px; width:300px;"></iframe>
</div>
</div>
</body>
</html>