An XElement
has a name, represented as an XName
. That XName
may or may not have a namespace associated with it. If it doesn't, the XName.Namespace
property will return XNamespace.None
.
An XName
is a fully-qualified name, basically - whereas XName.LocalName
will only give the local part.
So in your example:
- The local name is
Root
- The namespace URI is
http://www.adventure-works.com
The XName
with a namespace is not the same as an XName
without a namespace (or with a different namespace). So for example, the Element(XName)
method will not find an element with a name with the specified local name but a different namespace.