fix invalid XML issue

Sometimes errors would occur due to invalid characters like 0xC. These now get stripped.