I'm not very familiar with XML, but are you sure about these whitespace rules? You strip any whitespace off the text strings, and then re-insert a hard-coded single space between each chunk. It's probably not going to be an issue, but if we're going to handle odd cases, we may as well make sure it's right.