You can generate classes here:
Xml2CSharp.com | Convert your XML Examples into XmlSerializer compatible C# Classes[
^]
The rest is up to you :)
Example:
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
namespace Xml2CSharp
{
[XmlRoot(ElementName="BoardXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class BoardXML {
[XmlAttribute(AttributeName="imageId")]
public string ImageId { get; set; }
[XmlAttribute(AttributeName="serialNumber")]
public string SerialNumber { get; set; }
[XmlAttribute(AttributeName="assemblyRevision")]
public string AssemblyRevision { get; set; }
[XmlAttribute(AttributeName="boardType")]
public string BoardType { get; set; }
[XmlAttribute(AttributeName="boardRevision")]
public string BoardRevision { get; set; }
}
[XmlRoot(ElementName="StationXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class StationXML {
[XmlAttribute(AttributeName="testerName")]
public string TesterName { get; set; }
[XmlAttribute(AttributeName="stage")]
public string Stage { get; set; }
}
[XmlRoot(ElementName="RepairEventXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class RepairEventXML {
[XmlAttribute(AttributeName="numberOfVariationOkDefects")]
public string NumberOfVariationOkDefects { get; set; }
[XmlAttribute(AttributeName="numberOfFalseCalledPins")]
public string NumberOfFalseCalledPins { get; set; }
[XmlAttribute(AttributeName="numberOfRepairedComponents")]
public string NumberOfRepairedComponents { get; set; }
[XmlAttribute(AttributeName="numberOfVariationOkPins")]
public string NumberOfVariationOkPins { get; set; }
[XmlAttribute(AttributeName="numberOfRepairedPins")]
public string NumberOfRepairedPins { get; set; }
[XmlAttribute(AttributeName="numberOfRepairLaterPins")]
public string NumberOfRepairLaterPins { get; set; }
[XmlAttribute(AttributeName="numberOfFalseCalledDefects")]
public string NumberOfFalseCalledDefects { get; set; }
[XmlAttribute(AttributeName="numberOfActiveDefects")]
public string NumberOfActiveDefects { get; set; }
[XmlAttribute(AttributeName="numberOfVariationOkComponents")]
public string NumberOfVariationOkComponents { get; set; }
[XmlAttribute(AttributeName="repairEndTime")]
public string RepairEndTime { get; set; }
[XmlAttribute(AttributeName="repairStartTime")]
public string RepairStartTime { get; set; }
[XmlAttribute(AttributeName="numberOfRepairLaterDefects")]
public string NumberOfRepairLaterDefects { get; set; }
[XmlAttribute(AttributeName="repairOperator")]
public string RepairOperator { get; set; }
[XmlAttribute(AttributeName="numberOfRepairLaterComponents")]
public string NumberOfRepairLaterComponents { get; set; }
[XmlAttribute(AttributeName="numberOfActiveComponents")]
public string NumberOfActiveComponents { get; set; }
[XmlAttribute(AttributeName="numberOfActivePins")]
public string NumberOfActivePins { get; set; }
[XmlAttribute(AttributeName="numberOfRepairedDefects")]
public string NumberOfRepairedDefects { get; set; }
[XmlAttribute(AttributeName="numberOfFalseCalledComponents")]
public string NumberOfFalseCalledComponents { get; set; }
}
[XmlRoot(ElementName="RepairActionXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class RepairActionXML {
[XmlAttribute(AttributeName="repairOperator")]
public string RepairOperator { get; set; }
[XmlAttribute(AttributeName="repairTime")]
public string RepairTime { get; set; }
[XmlAttribute(AttributeName="repairActionType")]
public string RepairActionType { get; set; }
[XmlAttribute(AttributeName="indictmentType")]
public string IndictmentType { get; set; }
[XmlAttribute(AttributeName="comment")]
public string Comment { get; set; }
[XmlAttribute(AttributeName="repairStatus")]
public string RepairStatus { get; set; }
}
[XmlRoot(ElementName="ComponentXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class ComponentXML {
[XmlAttribute(AttributeName="packageId")]
public string PackageId { get; set; }
[XmlAttribute(AttributeName="partId")]
public string PartId { get; set; }
[XmlAttribute(AttributeName="designator")]
public string Designator { get; set; }
}
[XmlRoot(ElementName="IndictmentXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class IndictmentXML {
[XmlElement(ElementName="RepairActionXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public RepairActionXML RepairActionXML { get; set; }
[XmlElement(ElementName="ComponentXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public ComponentXML ComponentXML { get; set; }
[XmlAttribute(AttributeName="algorithm")]
public string Algorithm { get; set; }
[XmlAttribute(AttributeName="indictmentType")]
public string IndictmentType { get; set; }
}
[XmlRoot(ElementName="TestXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class TestXML {
[XmlElement(ElementName="IndictmentXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public IndictmentXML IndictmentXML { get; set; }
[XmlAttribute(AttributeName="name")]
public string Name { get; set; }
}
[XmlRoot(ElementName="BoardTestXMLExport", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public class BoardTestXMLExport {
[XmlElement(ElementName="BoardXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public BoardXML BoardXML { get; set; }
[XmlElement(ElementName="StationXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public StationXML StationXML { get; set; }
[XmlElement(ElementName="RepairEventXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public RepairEventXML RepairEventXML { get; set; }
[XmlElement(ElementName="TestXML", Namespace="http://tempuri.org/BoardTestXMLExport.xsd")]
public List<TestXML> TestXML { get; set; }
[XmlAttribute(AttributeName="ns1", Namespace="http://www.w3.org/2000/xmlns/")]
public string Ns1 { get; set; }
[XmlAttribute(AttributeName="numberOfIndictedComponents")]
public string NumberOfIndictedComponents { get; set; }
[XmlAttribute(AttributeName="testerTestStartTime")]
public string TesterTestStartTime { get; set; }
[XmlAttribute(AttributeName="testTime")]
public string TestTime { get; set; }
[XmlAttribute(AttributeName="repairStationId")]
public string RepairStationId { get; set; }
[XmlAttribute(AttributeName="testStatus")]
public string TestStatus { get; set; }
[XmlAttribute(AttributeName="testerTestEndTime")]
public string TesterTestEndTime { get; set; }
[XmlAttribute(AttributeName="numberOfIndictedPins")]
public string NumberOfIndictedPins { get; set; }
[XmlAttribute(AttributeName="numberOfComponentsTested")]
public string NumberOfComponentsTested { get; set; }
[XmlAttribute(AttributeName="numberOfJointsTested")]
public string NumberOfJointsTested { get; set; }
[XmlAttribute(AttributeName="numberOfDefects")]
public string NumberOfDefects { get; set; }
[XmlAttribute(AttributeName="repairStatus")]
public string RepairStatus { get; set; }
}
}