Different ways to access XML data in Silverlight Application
One of the most common requirement in the Silverlight development is to load XML data in to the application. I am going to describe a few different options that we can choose based on the situations. I am using LINQ for the XML parsing in the examples. Taking a sample XML file names Sample.xml with the following content < Employees > < Employee Name ="John" /> < Employee Name ="Mark" /> < Employee Name ="David" /> </ Employees > 1. Load XML file directly from the Web Server hosted Silverlight XAP You can host the XML file at your web server itself and Silverlight application can load it on demand. To simulate this in Visual Studio you need to create a Test Website for your Silverlight application and put xml file into the ClientBin folder. Now we can write few lines of code to read the XML. WebClient will download the file asynchronously void Page_Loaded( object sender, RoutedEventArgs e) { WebClient xmlClient = ...