title: Accessing namespaces through their namespace prefix
body: <p><a href="http://msdn.microsoft.com/en-us/library/bb387081.aspx" rel="nofollow">MSDN</a>:</p>
  
  <blockquote>
    <p>One of the advantages of using LINQ to
    XML with C# is that you do not have to
    use XML prefixes. When LINQ to XML
    loads or parses an XML document, each
    XML prefix is resolved to its
    corresponding XML namespace. After
    that, when you work with a document
    that uses namespaces, you almost
    always access the namespaces through
    the namespace URI, and not through the
    namespace prefix. When developers work
    with XML names in LINQ to XML they
    always work with a fully-qualified XML
    name (that is, an XML namespace and a
    local name).</p>
  </blockquote>
  
  <p>a) Uhm, is the above quote claiming that in Linq to XML developers always work with fully-qualified XML names and thus always access namespaces through their namespace URI and not through namespace prefix?</p>
  
  <p>But doesn't the following code access namespace through the prefix and not namespace URI ( and couldn't we also argue that in this example we aren't working with a fully qualified XML name ):</p>
  
  <pre><code>XNamespace aw = "http://www.adventure-works.com";
  IEnumerable&lt;XElement&gt; c1 =
      from el in root.Elements(aw + "Child")
      select el;
  </code></pre>
  
  <p>b)  why would in Linq to XML accessing namespaces through namespace URI be preferable to accessing them through a namespace prefix?</p>
  
  <p>thank you</p>
  
  <p><strong>EDIT:</strong></p>
  
  <blockquote>
    <p>Why do you think your code sample uses
    a prefix?</p>
  </blockquote>
  
  <p>I have no idea why I thought the above code uses a namespace prefix. </p>
  
  <p>1) is there a way to access namespace through the prefix and not namespace URI ( for example, when trying to find child elements using <code>XElement.Elements(Xname)</code> method )?</p>
  
  <p>2) Besides a document having both a default namespace and an additional namespace declaration for the same namespace, are there any other examples I should be aware of where prefixes in input document may not get preserved when document is serialized back? </p>