Fix bug #11298 - in XElement.Replace*(), create snapshot of content first before removal (unlike it is documented!)