public static void WriteElementPatent(XmlWriter writer, Patent patent)
        {
            var element = new XElement("patent");

            element.Add(new XElement("name", patent.Name.name, new XAttribute("required", "true")));
            element.Add(new XElement("inventors", patent.Inventors.Select(i => new XElement("inventor", i))));
            element.Add(new XElement("country", patent.Country));
            element.Add(new XElement("registrationNumber", patent.RegistrationNumber));
            element.Add(new XElement("applyDate", patent.ApplyDate.ToString("yyyyMMdd")));
            element.Add(new XElement("publicationDate", patent.PublicationDate.ToString("yyyyMMdd")));
            element.Add(new XElement("pageCount", patent.PageCount.ToString()));
            element.Add(new XElement("note", patent.Note));
            element.WriteTo(writer);
        }
 private static void WritePatent(XmlWriter writer, Patent patent)
 {
     writer.WriteStartElement("patent");
     writer.WriteStartElement("name");
     writer.WriteAttributeString("required", "true");
     writer.WriteString(patent.Name.name);
     writer.WriteEndElement();
     writer.WriteStartElement("inventors");
     foreach (var a in patent.Inventors)
     {
         writer.WriteElementString("inventor", a);
     }
     writer.WriteEndElement();
     writer.WriteElementString("country", patent.Country);
     writer.WriteElementString("registrationNumber", patent.RegistrationNumber);
     writer.WriteElementString("applyDate", patent.ApplyDate.ToString("yyyyMMdd"));
     writer.WriteElementString("publicationDate", patent.PublicationDate.ToString("yyyyMMdd"));
     writer.WriteElementString("pageCount", patent.PageCount.ToString());
     writer.WriteElementString("note", patent.Note);
     writer.WriteEndElement();
 }