title: What library to use for building HTML documents?
body: <p>Could please anybody recommend libraries that are able to do the opposite thing than these libraries ?</p>
  
  <p>HtmlCleaner, TagSoup, HtmlParser, HtmlUnit, jSoup, jTidy, nekoHtml, WebHarvest or Jericho.</p>
  
  <p>I need to build html pages, build the DOM model from String content.</p>
  
  <p>EDIT: I need it for testing purposes. I have various types of input/strings that might be in the html page on various places... So I need to dynamically build it up... I then process the html page based on various criterions that must be fulfilled or not.</p>
  
  <p>I will show you why I asked this question, consider htmlCleaner for this job :</p>
  
  <pre><code>List&lt;String&gt; paragraphs = getParagraphs(entity.getFile());
  List&lt;TagNode&gt; pNodes = new ArrayList&lt;TagNode&gt;();
  
  TagNode html = cleaner.clean("&lt;html/&gt;");
  for(String paragraph : paragraphs) {                
      TagNode p = new TagNode("p");
      pNodes.add(p);
      // CANNOT setText() ?
  }
  html.addChildren(pNodes);
  </code></pre>
  
  <p>The problem is that <code>TagNode</code> has <code>getText()</code> method, but no <code>setText()</code> method ....</p>
  
  <p>Please add more comments about how vague this question is ... The best thing you can do</p>