In Clojure there are a bunch of tools for doing this. One is hiccup, it's for server side html rendering. You can define a function that returns a Clojure datastructure like so:
(defn greeting [person]
[:h2 (str "Hey, " person)])
Then: (greeting "Paul")
;=> [:h2 "Hey, Paul"]
and: (hiccup/html (greeting "Paul"))
;=> "<h2>Hey Paul</h2>"
There are also tools for doing this in clojurescript. My favorite here is called Reagent (http://reagent-project.github.io/). It's a minimal wrapper for react.js that appeals to me because I can focus on my code since there's less to know compared to Om.