java: Escape inline documentation HTML for JavaDoc

Also validate the generated JavaDoc as HTML using xmllint.