title: How can I deserialize an XML response to an object when I only need a child element of the XML?
body: <p>I have the following XML that I am getting back from a WebRequest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;search&gt;
    &lt;total_items&gt;5&lt;/total_items&gt;
    &lt;page_size&gt;10&lt;/page_size&gt;
    &lt;page_count&gt;1&lt;/page_count&gt;
    &lt;page_number&gt;1&lt;/page_number&gt;
    &lt;page_items&gt;&lt;/page_items&gt;
    &lt;first_item&gt;&lt;/first_item&gt;
    &lt;last_item&gt;&lt;/last_item&gt;
    &lt;search_time&gt;0.044&lt;/search_time&gt;
    &lt;events&gt;
      &lt;event id="E0-001-053379749-0"&gt;
        &lt;title&gt;Antibalas&lt;/title&gt;
        &lt;url&gt;http://test.com&lt;/url&gt;
        &lt;description&gt;stuff&lt;/description&gt;
        &lt;start_time&gt;2013-01-30 20:00:00&lt;/start_time&gt;
        &lt;stop_time&gt;&lt;/stop_time&gt;
        &lt;tz_id&gt;&lt;/tz_id&gt;
        &lt;tz_olson_path&gt;&lt;/tz_olson_path&gt;
        &lt;tz_country&gt;&lt;/tz_country&gt;
        &lt;tz_city&gt;&lt;/tz_city&gt;
        &lt;venue_id&gt;V0-001-000189211-5&lt;/venue_id&gt;
        &lt;venue_url&gt;http://blah.com&lt;/venue_url&gt;
        &lt;venue_name&gt;Troubadour&lt;/venue_name&gt;
        &lt;venue_display&gt;1&lt;/venue_display&gt;
        &lt;venue_address&gt;9081 Santa Monica Boulevard&lt;/venue_address&gt;
        &lt;city_name&gt;West Hollywood&lt;/city_name&gt;
        &lt;region_name&gt;California&lt;/region_name&gt;
        &lt;region_abbr&gt;CA&lt;/region_abbr&gt;
        &lt;postal_code&gt;90069&lt;/postal_code&gt;
        &lt;country_name&gt;United States&lt;/country_name&gt;
        &lt;country_abbr2&gt;US&lt;/country_abbr2&gt;
        &lt;country_abbr&gt;USA&lt;/country_abbr&gt;
        &lt;latitude&gt;34.0815917&lt;/latitude&gt;
        &lt;longitude&gt;-118.3892462&lt;/longitude&gt;
        &lt;geocode_type&gt;EVDB Geocoder&lt;/geocode_type&gt;
        &lt;all_day&gt;0&lt;/all_day&gt;
        &lt;recur_string&gt;&lt;/recur_string&gt;
        &lt;calendar_count&gt;&lt;/calendar_count&gt;
        &lt;comment_count&gt;&lt;/comment_count&gt;
        &lt;link_count&gt;&lt;/link_count&gt;
        &lt;going_count&gt;&lt;/going_count&gt;
        &lt;watching_count&gt;&lt;/watching_count&gt;
        &lt;created&gt;2012-12-24 11:40:43&lt;/created&gt;
        &lt;owner&gt;evdb&lt;/owner&gt;
        &lt;modified&gt;2013-01-14 21:08:04&lt;/modified&gt;
        &lt;performers&gt;
          &lt;performer&gt;
            &lt;id&gt;P0-001-000000517-4&lt;/id&gt;
            &lt;url&gt;http://test.com&lt;/url&gt;
            &lt;name&gt;Antibalas&lt;/name&gt;
            &lt;short_bio&gt;Afro-beat / Funk / Experimental&lt;/short_bio&gt;
            &lt;creator&gt;jfisher&lt;/creator&gt;
            &lt;linker&gt;evdb&lt;/linker&gt;
          &lt;/performer&gt;
        &lt;/performers&gt;
        &lt;image&gt;
          &lt;url&gt;http://s4.evcdn.com/images/small/I0-001/000/070/311-5.jpeg_/antibalas-11.jpeg&lt;/url&gt;
          &lt;width&gt;48&lt;/width&gt;
          &lt;height&gt;48&lt;/height&gt;
          &lt;caption&gt;&lt;/caption&gt;
          &lt;thumb&gt;
            &lt;url&gt;http://s4.evcdn.com/images/thumb/I0-001/000/070/311-5.jpeg_/antibalas-11.jpeg&lt;/url&gt;
            &lt;width&gt;48&lt;/width&gt;
            &lt;height&gt;48&lt;/height&gt;
          &lt;/thumb&gt;
          &lt;small&gt;
            &lt;url&gt;http://s4.evcdn.com/images/small/I0-001/000/070/311-5.jpeg_/antibalas-11.jpeg&lt;/url&gt;
            &lt;width&gt;48&lt;/width&gt;
            &lt;height&gt;48&lt;/height&gt;
          &lt;/small&gt;
          &lt;medium&gt;
            &lt;url&gt;http://s4.evcdn.com/images/medium/I0-001/000/070/311-5.jpeg_/antibalas-11.jpeg&lt;/url&gt;
            &lt;width&gt;128&lt;/width&gt;
            &lt;height&gt;128&lt;/height&gt;
          &lt;/medium&gt;
        &lt;/image&gt;
        &lt;privacy&gt;1&lt;/privacy&gt;
        &lt;calendars&gt;&lt;/calendars&gt;
        &lt;groups&gt;&lt;/groups&gt;
        &lt;going&gt;&lt;/going&gt;
      &lt;/event&gt;
    &lt;/events&gt;
  &lt;/search&gt;
  </code></pre>
  
  <p>I have created the following classes:</p>
  
  <pre><code>public class EventSearch
  {
      public int total_items { get; set; }
      public int page_size { get; set; }
      public int page_count { get; set; }
      public int page_number { get; set; }
      public int page_items { get; set; }
      public string first_item { get; set; }
      public string last_item { get; set; }
      public string search_time { get; set; }
      public List&lt;Event&gt; events { get; set; }
  }
  
  public class Event
  {
      public string id { get; set; }
      public string title { get; set; }
      public string url { get; set; }
      public string description { get; set; }
      public DateTime start_time { get; set; }
      public string venue_id { get; set; }
      public string venue_url { get; set; }
      public string venue_name { get; set; }
      public string venue_address { get; set; }
      public string city_name { get; set; }
      public string region_name { get; set; }
      public string region_abbr { get; set; }
      public string postal_code { get; set; }
      public string country_name { get; set; }
      public string country_abbr { get; set; }
      public string country_abbr2 { get; set; }
      public double latitude { get; set; }
      public double longitude { get; set; }
      public List&lt;Performer&gt; performers { get; set; }
      public EventImage image { get; set; }
  }
  
  public class Performer
  {
      public string id { get; set; }
      public string url { get; set; }
      public string name { get; set; }
      public string short_bio { get; set; }
  }
  
  public class EventImage
  {
      public string url { get; set; }
      public int width { get; set; }
      public int height { get; set; }
      public Image thumb { get; set; }
      public Image small { get; set; }
      public Image medium { get; set; }
  }
  
  public class Image
  {
      public string url { get; set; }
      public int width { get; set; }
      public int height { get; set; }
  }
  </code></pre>
  
  <p>In the method that I am calling, I want to return a list of events. Here's what I have so far, which is giving me the error:</p>
  
  <blockquote>
    <p> was not expected.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>var request = WebRequest.Create(url);
  var response = request.GetResponse();
  
  if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK)
  {
      // Get the stream containing content returned by the server.
      Stream dataStream = response.GetResponseStream();
      // Open the stream using a StreamReader.
      StreamReader reader = new StreamReader(dataStream);
  
      XmlSerializer serializer = new XmlSerializer(typeof(EventSearch));
      EventSearch deserialized = (EventSearch)serializer.Deserialize(reader);
  
      return deserialized.events;
  }
  </code></pre>
  
  <p>I'm not sure what to do next. Do I need to annotate my classes?</p>