Q:

How to read xml file in uwp

How do you read a XML file that is stored in a server in UWP using C#?
I've tried downloading the XML file and then reading it using this code:
StorageFolder storageFolder = ApplicationData.Current.LocalFolder;
Uri address = new Uri("https://www.dropbox.com/s/lyf9lv03dogidb9/home.xml?dl=1");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
WebResponse response = await request.GetResponseAsync();
Stream stream = response.GetResponseStream();
StorageFile XMLfile = await storageFolder.CreateFileAsync("homemv.xml", CreationCollisionOption.ReplaceExisting);
await Windows.Storage.FileIO.WriteBytesAsync(XMLfile, ReadStream(stream));
//load data into flip view
StorageFile tempFile = await ApplicationData.Current.LocalFolder.GetFileAsync("homemv.xml");
String datas = await FileIO.ReadTextAsync(tempFile);
XDocument loadedData = XDocument.Load(datas);
var data = from query in loadedData.Descendants("mvinfo")
           select new MVData
           {
               VideoTitle = (string)query.Element("title"),
               VideoYear = (string)query.Element("year"),
               VideoSource = (string)query.Element("link"),
               ImageSource = (string)query.Element("imgSource")
           };
YouTubeMV.ItemsSource = data;

When I run the app, it shows an error that the Uri parameter must be a file system or absolute path. 
I've also tried using:
Uri uri = new Uri( "https://www.dropbox.com/s/lyf9lv03dogidb9/home.xml?dl=1");
XDocument document = XDocument.Load(uri);

But it also does not work. 

A:

XDocument.Load() does not take http sheme URIs - it is used for file access. 
What you want to do is XDocument.Load("C:/test.xml"); where C:/test.xml is the path to XML file. The file needs to be created before it is accessed of course.
If you want to create an XML from a stream, you can take a look here: XDocument Load - cannot open

