when writing xml ignore invalid characters