/// <summary> /// Performs an "exclusive-or" of the two SerializableLists, keeping only the elements that /// are in one of the SerializableLists, but not in both. The original SerializableLists are not modified /// during this operation. The result SerializableList is a <c>Clone()</c> of this SerializableList containing /// the elements from the exclusive-or operation. /// </summary> /// <param name="a">A SerializableList of elements.</param> /// <returns>A SerializableList containing the result of <c>a ^ b</c>.</returns> public virtual SerializableList <T> ExclusiveOr(SerializableList <T> a) { SerializableList <T> resultSerializableList = (SerializableList <T>) this.Clone(); foreach (T element in a) { if (resultSerializableList.Contains(element)) { resultSerializableList.Remove(element); } else { resultSerializableList.Add(element); } } return(resultSerializableList); }