Actually, I probably should have caught this before, but the right way to do this is clearly to create a new XArray instead of mutating the old one.