I'm having problems with unprintable characters in XML that's been copied and pasted in. Mostly character code 160 (decimal), seems to be the problem.

I was trying to remove them all with a regular expression:-

xml = XML(xml.toXMLString().replace(/(\x00-\x1F)|(\x7F-\xFF)/g,''));

But this has no effect whatsoever. Does anyone have a solution? (apart from a primitive loop that traverses and examines every .charCodeAt(i))