title: Ignore outer elements using XmlSerializer
body: <p>I am trying to deserialize the XML document:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;eveapi version="2"&gt;
    &lt;currentTime&gt;2013-07-07 07:24:20&lt;/currentTime&gt;
    &lt;result&gt;
      &lt;rowset name="characters" key="characterID" columns="name,characterID,corporationName,corporationID"&gt;
        &lt;row name="xxxxx" characterID="1234" corporationName="xxxx" corporationID="1234" /&gt;
      &lt;/rowset&gt;
    &lt;/result&gt;
    &lt;cachedUntil&gt;2013-07-07 07:40:39&lt;/cachedUntil&gt;
  &lt;/eveapi&gt;
  </code></pre>
  
  <p>My model is:</p>
  
  <pre><code>[XmlRoot("rowset")]
  public class CharacterList
  {
      public CharacterList() { Characters = new List&lt;Character&gt;(); }
  
      [XmlElement("row")]
      public List&lt;Character&gt; Characters { get; set; }
  }
  
  public class Character
  {
      [XmlElement("name")]
      private string name { get; set; }
  
      [XmlElement("characterID")]
      private int Id { get; set; }
  
      [XmlElement("corporationName")]
      private string corporationName { get; set; }
  
      [XmlElement("corporationID")]
      private int corporationId { get; set; }
  }
  </code></pre>
  
  <p>My deserialization code is:</p>
  
  <pre><code>XmlRootAttribute xRoot = new XmlRootAttribute();
  xRoot.ElementName = "result";
  xRoot.IsNullable = true;
  var serializer = new XmlSerializer(typeof(Character), xRoot);
  var list = (CharacterList) serializer.Deserialize(output);
  </code></pre>
  
  <p>However, I am getting an exception:</p>
  
  <pre><code>System.InvalidOperationException: There is an error in XML document (2,2).
  </code></pre>
  
  <p>with an inner type:</p>
  
  <pre><code>System.InvalidOperationException: &lt;eveapi xmlns=''&gt; was not expected.
  </code></pre>
  
  <p>I'm pretty sure this is because of the outer information I do not need. Is there a way I can ignore it? my other thought was I could write wrapper classes for the rest of the schema, then just ignore what I don't care about. However, I was hoping there is an easier way. I've been stuck on this for a while, any help would be appreciated.</p>