> I am trying to find a first element from an xml file using the
> following code
[quoted text clipped - 4 lines]
> if there are any elements available before I pick the first element.
> Is it possible to do it in a single statement?
Use
XElement t = xml.Descendants("Element").FirstOrDefault();
that way t will be the first 'Element' descendant or nul if there is none.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
CSharper - 02 Apr 2008 15:15 GMT
> > I am trying to find a first element from an xml file using the
> > following code
[quoted text clipped - 13 lines]
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
Thanks for the help.