Does anyone know how to generate an HTMLDocument object programmatically in Java without resorting to generating a String externally and then using HTMLEditorKit#read to parse i
You can use any decent xml library like JDom or Xom or XStream. Html is just a special case of XML.
Or, you can use one of the existing templating engines for server side java like jsp or velocity.