Imports System Public Class SimpleExampleUsage ' This example creates a new document, fills it up a bit and then saves it to disk. Public Shared Sub CreateNew() ' Create a new DOM root elemnt. Dim newDocumentRootElement As New ObjectModelGenerator.MyDataSetElement ' Fill it up with new data. Dim customer1 As New ObjectModelGenerator.MyDataSetElement.customersElement customer1.CustomerID = 14D customer1.CompanyName = "Give Us All Your Money Inc." customer1.Phone = "555-1234" newDocumentRootElement.customerss.Add(customer1) Dim customer2 As New ObjectModelGenerator.MyDataSetElement.customersElement ' This means that the customer id will not get serialized, due to it being null. customer1.SetCustomerIDNull() customer1.CompanyName = "Rotten To The Corp." customer1.Phone = "555-9872" newDocumentRootElement.customerss.Add(customer2) ' Create an xml document from the dom. Dim actualXmlDocument As ObjectModelGenerator.MyDataSetDocument = ObjectModelGenerator.MyDataSetDocument.FromDOM(newDocumentRootElement) ' Save the xml document to file. actualXmlDocument.Save("customers.xml") End Sub 'CreateNew ' This example loads the document we have created. Public Shared Sub LoadFromFile() ' Create a blank xml document object. Dim actualXmlDocument As New ObjectModelGenerator.MyDataSetDocument ' Load the data from the xml file. Note: This validates the XML. Prone to exceptions. actualXmlDocument.Load("customers.xml") ' Create the DOM from the xml. Dim rootElement As ObjectModelGenerator.MyDataSetElement = actualXmlDocument.CreateDOM() End Sub 'LoadFromFile End Class 'SimpleExampleUsage