How to obtain the xml element name corresponding to the binding data type in c#

Oct 16, 2012 at 9:59 AM
Edited Oct 16, 2012 at 10:00 AM

I have used xsd2code and generated c# classes for my xsd. In my xsd i have elements such as 

<xs:element name="helloworld" type="HelloWorldData"/>

I read an xml using xmlserializer, and it is bound to the data type HelloWorldData, is there any way i can obtain the xml element name "helloworld" from its type "HelloWorldData" in c#, at run time?

Note: the mappings are unique, each element has its unique data type

Thanks,

Ashish

Also asked the question on stack overflow