The latest version of CSharp_MARC has a new class: FileMARCXMLWriter. While my previous releases were able to import and manipulate records that were stored as XML, they did not have the capability of writing them back out. With this release, CSharp MARC finally has full MARCXML support. Just like FileMARCWriter, it supports both List<Record> as well as individual records. In addition, the Record object has a new function ToXML(), which returns an XDocument. Fields and Subfields also have a ToXML() function, each that return an XElement that matches the given field or subfield if you wish to use them. Making use of the new ToXML functions requires adding "using System.Xml.Linq" to your project's using statements.
The official release will happen after I do some more testing, but for now you can get started using MARCXML by downloading the latest code from the Sourceforge SVN tree.
Here's a quick example of the new FileMARCXMLWriter's use:
List<Record> records = new List<Record>(); //Fill your list of records just like you always have FileMARCXMLWriter writer = new FileMARCXMLWriter(filename); writer.Write(records); writer.Dispose();