http://www.codeproject.com/KB/linq/xelementns.aspx
string myxml =
@" <root>
<one xmlns:a='http://rediff.com'>
<a:oneone sequenceId= '11' xmlns:b='http://yahoo.com'>
<b:id>1</b:id>
<b:name></b:name>
</a:oneone>
<a:twotwo xmlns:b='http://orkut.com'>
<b:id>1</b:id>
<b:name></b:name>
</a:twotwo>
</one>
</root> ";
XNamespace nsr = " http://rediff.com ";
XNamespace nsy = " http://yahoo.com ";
XElement elem = XElement.Parse(myxml);
string t = elem.Element( " one ").Element(nsr + " oneone ").Element(nsy + " id ").Value;
string sequenceId = elem.Element( " one ").Element(nsr + " oneone ").Attribute( " sequenceId ").Value;
XDocument doc = new XDocument();
doc = XDocument.Parse(myxml);
XElement docElement = doc.Descendants(nsr + " oneone ").FirstOrDefault();
string t1 = docElement.Element(nsr + " oneone ").Element(nsy + " id ").Value;
string sequenceId1 = docElement.Element(nsr + " oneone ").Attribute( " sequenceId ").Value;
@" <root>
<one xmlns:a='http://rediff.com'>
<a:oneone sequenceId= '11' xmlns:b='http://yahoo.com'>
<b:id>1</b:id>
<b:name></b:name>
</a:oneone>
<a:twotwo xmlns:b='http://orkut.com'>
<b:id>1</b:id>
<b:name></b:name>
</a:twotwo>
</one>
</root> ";
XNamespace nsr = " http://rediff.com ";
XNamespace nsy = " http://yahoo.com ";
XElement elem = XElement.Parse(myxml);
string t = elem.Element( " one ").Element(nsr + " oneone ").Element(nsy + " id ").Value;
string sequenceId = elem.Element( " one ").Element(nsr + " oneone ").Attribute( " sequenceId ").Value;
XDocument doc = new XDocument();
doc = XDocument.Parse(myxml);
XElement docElement = doc.Descendants(nsr + " oneone ").FirstOrDefault();
string t1 = docElement.Element(nsr + " oneone ").Element(nsy + " id ").Value;
string sequenceId1 = docElement.Element(nsr + " oneone ").Attribute( " sequenceId ").Value;