Thanks, Alexander and everybody for your remarks and observations. As it happens, in the meantime I've found the reason: it is the boundary-space policy, which can either be "preserve" or "strip" and which a boundary-space declaration of the prolog can explicitly choose (overriding the implementation-defined default) [1]. Therefore: declare boundary-space preserve; serialize(<e> </e>)
yiels <e> </e> as it should, hurray! One of so many opportunities to note the high quality of BaseX which honours such a rather obscure declaration. The XQuery spec also states explicitly that xml:space has no effect in this context (from [2]):"Element constructors treat attributes namedxml:space as ordinary attributes. Anxml:space attribute does not affect the handling ofwhitespace by an element constructor." So BaseX is doing just the right thing.
Everything is fine! Cheers,Hans-Jürgen PS: For the interest, here the definition of boundary-whitespace ([2]):[Definition: Boundarywhitespace is a sequence of consecutive whitespace characterswithin the content of a direct element constructor, that isdelimited at each end either by the start or end of the content, orby a DirectConstructor, or by anEnclosedExpr. For thispurpose, characters generated by character references such as  or by CDataSections are not consideredto be whitespace characters.] [1] https://www.w3.org/TR/xquery-31/#id-boundary-space-decls%5B2] https://www.w3.org/TR/xquery-31/#id-whitespace
Alexander Holupirek alex@holupirek.de schrieb am 11:00 Freitag, 9.September 2016:
On 08.09.2016, at 23:17, Hans-Juergen Rennau hrennau@yahoo.de wrote:
Dear BaseX team,
is this a bug?
serialize(<e> </e>)
returns
<e/>
I need my blanks!
Hans-Jürgen
Maybe your data is stored/processed with whitespaces stripped off?