In some applications, embedding the XML inline within the XAML page can be inconvenient because the exact content of the data must be known at compile time. Therefore, you can obtain the data from an external XML file, as in the following example.
<XmlDataProvider x:Key="BookData" Source="data\bookdata.xml" XPath="Books"/>
For the complete code sample, see XMLDataProvider with Embedded Data File Sample.
If the XML data resides in a remote XML file, you define access to the data by assigning an appropriate URL to the Source attribute as follows:
<XmlDataProvider x:Key="BookData" Source="http://MyUrl" XPath="Books"/>