A kotlinx.html library provides DSL to build HTML
kotlinx.html is a library for building HTML pages for the Kotlin language. You can use it on both server and client side. Also it provides way to build HTML pages to a stream and to a DOM tree.
See wiki for more info.