Read your code carefully and check if it does what it should do:
XmlNode data2 = xDoc.CreateElement("DATA");
foreach (KeyValuePair<Int16, Wire> kvp in _wires)
{
data2.AppendChild(wire);
}
subNode2.AppendChild(data2);
There may be more errors that you should be able to find yourself.