> I would occasionally like to work with multi-line information which will be provided by
data structures that are not XML formats.
The best practice is the same as the best practice for encodings other than UTF-8 (or notionally UTF-16); you convert the source data on the way in, handle it in the expected way, and convert to the target encoding, format, or data structure on the way back out.
Whether in the case of multi-line information that's handled by conversion to an XML representation on intake, or by an encapsulating function at processing time, or by something already in the static context (such as csv:parse() in BaseX) is a lot less important than avoiding trying to make XML care about whitespace. It won't, you can't make it, and the effort leads to frustration. (The world is full of people marking up addresses with new lines, even in XML data; sometimes it's an empty newline element, rather than a newline character. Sticking the line worth of text into an element makes everything simpler.)
-- Graydon