Feature/illegalunicode

Add option to escape bad xml chars if error occurs.

@rjohnsondev @robcowie @rvitale