Hi
just i modified your code and make it according to your need...
{
XmlDataSource oXmlDataSource = new XmlDataSource();
oXmlDataSource.XPath = "siteMap/siteMapNode";
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath(".") + "\\LoadRole.xml");
XmlNode root = doc.DocumentElement;
XmlNodeList nodeList = doc.SelectNodes("/RolesList/Roles[@ID=01]");
drpUpdateRole.Items.Insert(0, new ListItem(string.Empty, string.Empty));
List<ListItem> items = new List<ListItem>();
foreach (XmlNode node in nodeList)
{
for (int i = 0; i < node.ChildNodes.Count; i++)
{
string text = node.ChildNodes[i].InnerXml;
string xml = @"<Test>" + text + "</Test>";
XDocument doc2 = XDocument.Parse(xml);
List<Tuple<string, string>> list = doc2.Descendants().Select(a => new Tuple<string, string>(a.Name.LocalName, a.Value)).ToList();
items.Add(new ListItem(list[1].Item2, list[2].Item2));
}
}
drpUpdateRole.Items.AddRange(items.ToArray());
}
jmd
:-)