Hi Christian,
I have the comment node <!—-—>. If I extract its content with data() in an element, I get the following: <g>&#45;</g>, and it seems there is no way to force &#45; to become - within the element: I found a workaround to replace &#45; with a dash '-', and this seems the best solution at the moment. My problem is that I have to refer to the positions of these characters (as character offsets), and therefore any change when I move a character from a comment node to an element node could break my reference system (indeed, &#45; is not equivalent to - in BaseX: is the rendering of - as &#45; correct?).
Ciao,
Giuseppe