copy htmlvisitor code to TreeToHtmlConverter