I guess setting just ignore the white space in the content, but still create the text node. I'm pretty sure if you remove all spaces and line spacing between each element (i.e. make whole xml into one line), you can then elimiate all #text nodes.
Or if you are using xerces parser, you can...