"XML Tools" html whitespace

Hello
I’m writing a script where I need to parse an HTML file. Therefor I use XML tools library from LateNightSoftware. But when I parsed an HTML file with the parse XML command it ignored the whitespace. So for example when I ran this:

parse XML "<html>
  <body>
    <p>Some <b>bold</b> text</p>
  </body>
</html>
"

It returned this {class:XML document, XML tag:“html”, XML contents:{{class:XML element, XML tag:“body”, XML contents:{{class:XML element, XML tag:“p”, XML contents:{“Some”, {class:XML element, XML tag:“b”, XML contents:{“bold”}}, “text”}}}}}}
Notice that there is no space after “Some” So I found in the library that there was an option “preserving whitespace”
but when I used that in another script:

parse XML "<html>
  <body>
    <p>Some <b>bold</b> text</p>
  </body>
</html>
" with preserving whitespace

It also included the returns and thats not what I wanted. I just wanted to parse the xml the way a browser does (reduce more than one spaces or returns to one space). Can anybody help me with this?
Thanks in advance
Damiaan

AppleScript: Versie 2.4.2 (131)
Browser: Safari 534.55.3
Operating System: Mac OS X (10.7)

I never tried the XML tools, but the parsing should not change, if all (sequences of) white space in the file are replaced by a single space, before parsing it.

People have different preferences for different grep solutions, I tend to use PHP:

set php_script to quoted form of "print (preg_replace('/\\s+/', ' ', $argv[1]));"
set x to quoted form of "abc	def


ghi"

set cmd to "php -r " & php_script & " " & x
set cleaned_text to (do shell script cmd)

returns ““abc def ghi””. Something in that line should solve the problem.

Jürgen