This way you are trying to serialize an object of type ObservableCollection, soon will not have control of the name displayed in the xml tag. You need another class named Codes with a property that contains this collection and XmlElement attribute with parameter Code.
var codes = new Codes { CodeCollection = codeCollection };
XmlSerializer _serializer = new XmlSerializer(typeof(Codes));
using (StreamWriter _writer = new StreamWriter(@"LocalCodes.xml"))
{
_serializer.Serialize(_writer, codes);
}