XmlWriter AssembDataWrite = XmlWriter.Create(savepath);
AssembDataWrite.WriteStartDocument();
AssembDataWrite.WriteStartElement("Assemblies");
AssembDataWrite.WriteStartElement("Assembly");
AssembDataWrite.WriteElementString("UniqueNumber",abr.UniqueNumber); //VIN
AssembDataWrite.WriteElementString("AssemblyNumber", abr.AssemblyNumber); //VAN
AssembDataWrite.WriteElementString("AssemblyType",abr.AssemblyType);//VP代码(PIC)
AssembDataWrite.WriteElementString("ProductionPlantID", abr.ProductionPlantID);
AssembDataWrite.WriteStartElement("Productions");
AssembDataWrite.WriteStartElement("Production");
AssembDataWrite.WriteElementString("TimeStamp", abr.TimeStamp.ToString());
//AssembDataWrite.WriteElementString("ProtocolNumber", System.Guid.NewGuid().ToString());
AssembDataWrite.WriteElementString("ProtocolNumber", abr.ProtocolNumber);
AssembDataWrite.WriteElementString("EngineType", EngineType);
AssembDataWrite.WriteElementString("EnginePartNumber", abr.EnginePartNumber);
//AssembDataWrite.WriteElementString("MarketCode", Engine[3]);
AssembDataWrite.WriteStartElement("FCSs");
AssembDataWrite.WriteStartElement("FCS"); //开始元素
AssembDataWrite.WriteStartAttribute("DD"); //开始此元素的属性
AssembDataWrite.WriteString("SS"); //写入属性值
AssembDataWrite.WriteEndAttribute(); //关闭属性
AssembDataWrite.WriteString("12232"); //写入元素值
AssembDataWrite.WriteEndElement(); //结束本元素
AssembDataWrite.WriteEndElement();
AssembDataWrite.WriteEndElement();
AssembDataWrite.WriteEndElement();
AssembDataWrite.WriteEndElement();
AssembDataWrite.WriteEndElement();
AssembDataWrite.WriteEndDocument();
AssembDataWrite.Flush();
AssembDataWrite.Close();