how to access xml element with prefix or namespace in c#
<p>hey can any one help me ... i am also facing the same problems but the solution given is not working for me . i also googled so much ... but unable to find any solution ...</p>

<p>Effort that i made , finally look like ---</p>

<pre><code>protected void GetRSS(string url)
{
    WebRequest MyRssRequest = WebRequest.Create(url);
    WebResponse MyRssResponse = MyRssRequest.GetResponse();
    Stream MyRssStream = MyRssResponse.GetResponseStream();
    XmlDocument MyRssDocument = new XmlDocument();
    MyRssDocument.Load(MyRssStream);

    XmlNamespaceManager nsmgr = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("dc", "http://purl.org/dc/elements/1.1/");

    XmlNamespaceManager nsmgrcontent = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("content", "http://purl.org/rss/1.0/modules/content/");

    XmlNamespaceManager nsmgrwfw = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("wfw", "http://wellformedweb.org/CommentAPI/");

    XmlNamespaceManager nsmgratom = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("atom", "http://www.w3.org/2005/Atom");

    XmlNamespaceManager nsmgrsy = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("sy", "http://purl.org/rss/1.0/modules/syndication/");

    XmlNamespaceManager nsmgrslash = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("slash", "http://purl.org/rss/1.0/modules/slash/");

    XmlNamespaceManager nsmgrgeorss = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("georss", "http://www.georss.org/georss");

    XmlNamespaceManager nsmgrgeo = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#");

    XmlNamespaceManager nsmgrmedia = new XmlNamespaceManager(MyRssDocument.NameTable);
    nsmgr.AddNamespace("media", "http://search.yahoo.com/mrss/");


    XmlNodeList MyRssList = MyRssDocument.SelectNodes("rss/channel/item");
    string sTitle = "";
    string sLink = "";
    string sDescription = "";
    string sPubDate = "";
    string sCreator = "";
    // Iterate/Loop through RSS Feed items
    for (int i = 0; i &lt; MyRssList.Count; i++)
    {
        XmlNode MyRssDetail;

        MyRssDetail = MyRssList.Item(i).SelectSingleNode("title");
        if (MyRssDetail != null)
        {
            sTitle = MyRssDetail.InnerText;
        }
        else
        {
            sTitle = "";
        }

        MyRssDetail = MyRssList.Item(i).SelectSingleNode("link");
        if (MyRssDetail != null)
        {
            sLink = MyRssDetail.InnerText;
        }
        else
        {
            sLink = "";
        }

        MyRssDetail = MyRssList.Item(i).SelectSingleNode("description");
        if (MyRssDetail != null)
        {
            sDescription = MyRssDetail.InnerText;
        }
        else
        {
            sDescription = "";
        }

        MyRssDetail = MyRssList.Item(i).SelectSingleNode("pubDate");
        if (MyRssDetail != null)
        {
            sPubDate = MyRssDetail.InnerText;
        }
        else
        {
            sPubDate = "";
        }

        MyRssDetail = MyRssList.Item(i).SelectSingleNode("creator", nsmgr);
        if (MyRssDetail != null)
        {
            sCreator = MyRssDetail.InnerText;
        }
        else
        {
            sCreator = "";
        }

        string JournalistName = MyRssList.Item(i).SelectSingleNode("lastBuildDate").NextSibling.InnerText;

        HtmlTableCell block = new HtmlTableCell();
        // You can style the Title From Here
        block.InnerHtml = "&lt;span style='font-weight:bold'&gt;&lt;a href='" + sLink + "' target='new'&gt;" + sTitle + "&lt;/a&gt;&lt;/span&gt;";               
        HtmlTableRow row = new HtmlTableRow();
        row.Cells.Add(block);
        tbl_Feed_Reader.Rows.Add(row);

        HtmlTableCell block_description = new HtmlTableCell();
        //You can style the Description from here
        block_description.InnerHtml = "&lt;p align='justify'&gt;" + sDescription + "&lt;/p&gt;";
        HtmlTableRow row2 = new HtmlTableRow();
        row2.Cells.Add(block_description);
        tbl_Feed_Reader.Rows.Add(row2);

        HtmlTableCell block_pubdate = new HtmlTableCell();
        //You can style the Description from here
        block_pubdate.InnerHtml = "&lt;p align='justify'&gt;" + sPubDate + "&lt;/p&gt;";
        HtmlTableRow row3 = new HtmlTableRow();
        row3.Cells.Add(block_pubdate);
        tbl_Feed_Reader.Rows.Add(row3);


        HtmlTableCell block_creator = new HtmlTableCell();
        //You can style the Description from here
        block_creator.InnerHtml = "&lt;p align='justify'&gt;&lt;b&gt;" + JournalistName + "&lt;/b&gt;&lt;/p&gt;";
        HtmlTableRow row4 = new HtmlTableRow();
        row4.Cells.Add(block_creator);
        tbl_Feed_Reader.Rows.Add(row4);

    }
}
</code></pre>

<p>and the section given below is giving me null as element ...</p>

<pre><code>MyRssDetail = MyRssList.Item(i).SelectSingleNode("creator", nsmgr);
if (MyRssDetail != null)
{
    sCreator = MyRssDetail.InnerText;
}
else
{
    sCreator = "";
}
</code></pre>