Store properties or fields of a class in a dictionary

I want to create a window where the user can map fields from an XML file to fields or properties of a class and later access the mapping for importing the same XML structure. For example I have the order class:

public class Order {     [Key]     public string OrderId { get; set; }     public int Status { get; set; }     public DateTime ImportDate { get; set; } } 

And the XML:

<Order>   <Header>     <OrderNo>4711</OrderNo>     <OrderStatus>20</OrderStatus>     <OrderConfirmed>1</OrderConfirmed>     <OrderReference>test</OrderReference>   </Header> </Order> 

Now my idea is to use a simple Linq to XML method:

    var ordersInXml = xDoc.Root                         .Elements("Header")                         .Select(x => new Order()                         {                             OrderId = (string)x.Descendants("OrderNo").First().Value,                             OrderStatus = (string)x.Descendants("OrderStatus").First().Value                          })                     .ToList(); 

I want to be able to somehow build a method which maps the attributes of the XML to the fields of my class. For example access a dictionary in my Linq to XML code? I have no good idea how to achieve that. Any better ideas?