In XSLT there are two XML documents: the stylesheet and the source document to be transformed. In Kauri template, the template is equivalent to the stylesheet, and there is no source document.
The rules for whitespace stripping from the stylesheet can be found here (XSLT 2):
http://www.w3.org/TR/xslt20/#stylesheet-stripping
I suggest we follow something similar, summarized: remove of all-whitespace nodes, use ktl:text to force whitespace to be kept, take xml:space attribute into account.
Are there places where whitespace can always be removed, regardless of xml:space? For example, in choose/when structures.
Whitespace removal should happend during template compilation, and should hence only be done on the template source, and not on e.g. inserted external content.