XPath is your friend, here's a small app that fetches the rate from that source;
using System;
using System.Globalization;
using System.Xml;
using System.Xml.XPath;
namespace XmlTest
{
class Program
{
static decimal GetRate(string code)
{
XPathDocument document = new XPathDocument("http://www.nationalbanken.dk/dndk/valuta.nsf/valuta.xml");
XPathNavigator navigator = document.CreateNavigator();
XmlNamespaceManager manager = new XmlNamespaceManager(navigator.NameTable);
manager.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
XPathNavigator node = navigator.SelectSingleNode(String.Format("/exchangerates/dailyrates/currency[@code='{0}']/@rate", code), manager);
return Decimal.Parse(node.Value, NumberStyles.AllowDecimalPoint, CultureInfo.GetCultureInfoByIetfLanguageTag("da-DK"));
}
static void Main(string[] args)
{
decimal rate = GetRate("EUR");
Console.WriteLine("Rate=" + rate);
}
}
}
Hope this helps,
Fredrik Bornander