import std/xmltree let x = newXmlTree("foo",[ newXmlTree("bar",[ newText("Hola"), newXmlTree("qux",[ newXmlTree("plugh",[]) ]) ]) ]) echo x Run <foo> <bar>Hola <qux> <plugh /> </qux></bar> </foo> Run
<https://github.com/nim-lang/Nim/blob/0cdbf5e04eeb8b5eb4ac706282563d3623ea5e2f/lib/pure/xmltree.nim#L609> Nodes that are considered "noWhitespace" due to containing text, are still indented.