I have an app where the user upload an unknown XML file for me where I read the content (I take each Element and Attribute name) and he can selects which Attribute or Element make reference to each object property. So the user config how to serialize your XML with our Object. And I save the mapping..
So the problem is which is the best practice to convert this XML file to my Object. Keeping in mind that the XML can contain unknown Attribute or Element values.
For example:
<Students>
<Student>
<Id>474</Id>
<Name>Test</Name>
</Student>
</Students>
And the object:
public clas Student{
public string cod{ get; set; }
public string name{ get; set; }
}
I attach an image of how the user define the correlation between the XML elements or attributes and our model class: