Monkey patched xmlbuilder to handle surrogate pair characters

Fix for #584