title: How do I get data from multiple XML files in Windows Phone
body: <p>I have an initial XML file stored in my phone which is accessed to select a number of elements.  Each element has a corresponding online XML file which I need to access to get more information.</p>
  
  <pre><code>string name, photo;
  
  foreach (int num in combi)
  {
      no = xElem.Descendants("employee").ElementAt(num).Descendants("no").First().Value;
      WebClient wc = new WebClient();
      wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler
          (Info_DownloadStringCompleted);
      wc.DownloadStringAsync(new Uri
          ("http://example.com/" + name));
      list.Add(new Person(no, name, photo);    
  }
  
  void Info_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
  {
      if (e.Error != null) return;
      XElement xml = XElement.Parse(e.Result);
      name = xml.Element("name").Value;
      photo = xml.Element("photo").Value;
  }
  </code></pre>
  
  <p>However, it seems that the list.Add goes first before the XML is downloaded resulting into a list with empty values for name and photo.  I confirmed this by placing MessageBox in both the foreach loop and Info_DownloadStringCompleted.  Is there a better way of doing this?</p>