XML To Objects:

The following code is an example of how to convert an XML document into a list of objects.

First we will look at the XML, here we can have 1 to N number of car details within the array of car details:

Now we will build an entity class to sit within our entity layer, used to pass the data from data layer to business layer upto the UI layer.

Next is the method to convert the XML into a list of objects of the type CarDetails:

Finally this is the method that will call the XML to objects method and returns a list or car detail objects.