Using the example XML file below, I created via the xsd tool, a class so as to be able to serialize/deserialize the data. The generated class, as per usual, has an Items collection of booksBook objects. So once I deserialize into the class from the file, populating the Items collection...how do I then delete 1 or more of the items in the collection? And then, of course, I want to Serialize again to change the on disk file contents.
// Sample Xml File
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<title>For Whom The Bell Tolls</title>
<author>Bob Straub></author>
</book>
<book>
<title>It Takes a Village</title>
<author>Lesbian First Lady Bitch</author>
</book>
</books>
// Generated class
//
// This source code was auto-generated by xsd, Version=1.1.4322.2032.
//
using System.Xml.Serialization;
[System.Xml.Serialization.XmlRootAttribute(Namespac e="", IsNullable=false)]
public class books
{
[System.Xml.Serialization.XmlElementAttribute("book ", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public booksBook[] Items;
}
public class booksBook
{
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string title;
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string author;
}