XML tree creator using a functional DSL