remove invalid xml chars before output for #313