Validate xml when loading a buffer