Tweak the generated XML to account for bad input JSON

- Add single quote to the list of characters to escape.
- Add the ability to replace illegal XML Name characters, which can be handy when dealing with malformed JSON input strings.