title: How to define multiple names for XmlElement field?
body: <p>I have a XML document provided by client applications to my C# application. This is how a client sends the XML file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;SomeAccount&gt;
      &lt;parentId&gt;2380983&lt;/parentId&gt;
      &lt;!-- more elements --&gt;
  &lt;/SomeAccount&gt;
  </code></pre>
  
  <p>And a C# class that supports the XML deserialization:</p>
  
  <pre><code>[XmlRoot]
  public class SomeAccount
  {
      [XmlElement("parentId")]
      public long ParentId { get; set; }
      //rest of fields...
  }
  </code></pre>
  
  <p>But there are some clients whose system send the XML in this way (note the upper case in <code>LeParentId</code>):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;SomeAccount&gt;
      &lt;LeParentId&gt;2380983&lt;/LeParentId&gt;
      &lt;!-- similar for the other elements --&gt;
  &lt;/SomeAccount&gt;
  </code></pre>
  
  <p>How can I make this field (and others) to support both XML names <code>parentId</code> and <code>LeParentId</code>?</p>
  
  <p>This is the method I'm currently using for XML deserialization:</p>
  
  <pre><code>public sealed class XmlSerializationUtil
  {
      public static T Deserialize&lt;T&gt;(string xml)
      {
          if (xml == null)
              return default(T);
          XmlSerializer serializer = new XmlSerializer(typeof(T));
          StringReader stringReader = new StringReader(xml);
          return (T)serializer.Deserialize(stringReader);
      }
  }
  </code></pre>
  
  <p>I tried to add <code>[XmlElement]</code> twice in the field, one per element name, but that didn't work.</p>