DOMParser + Whitespace

I had some error regarding whitespace after special characters. After resolving the error of special characters in text by string replacement, I realise excess whitespaces within text are removed.

somewhere in my DoM Tree:

Dim replacestring as string

domparser.output(replacestring)

but if i had remained with:

domparser.output(node.nodevalue)

the excess whitespaces remains.

Is there a way that i can preserve the excess whitespaces (crucial for me to retain the format of the text) or have i resolved the issue of special characters wrongly?