title: how do I avoid getting the empty namespace in newly created XElement?
body: <p>I am trying to delete then add a pageFooter to an xml document from a different file:   </p>
  
  <pre><code>XNamespace rep = "http://developer.cognos.com/schemas/report/8.0/";
  
  //remove pageFooter
  doc.Root.Descendants().Where(e=&gt;e.Name == rep + "pageFooter").Remove();
  
  //create and load pagefooter from file
  XElement pageFooter = XElement.Load(@"C:\pageFooter.xml");
  </code></pre>
  
  <p>and I am getting the empty namespace:</p>
  
  <pre><code>&lt;pageFooter xmlns=""&gt;
      &lt;contents&gt;
           ..............
  </code></pre>
  
  <p>I tried all of the following to add the namespace to the new element, nothing works:</p>
  
  <pre><code>XElement pagefooter = new XElement(rep+"pageFooter"); 
  pageFooter = XElement.Load(@"C:\pageFooter.xml");        
  //this has no effect
  
  pageFooter.Name = rep.GetName(pageFooter.Name.LocalName);
  //this moves the xmlns="" to the next descendant, &lt;contents&gt;
  
  pageFooter.Add(rep);   
  //this has no effect
  
  pageFooter.SetAttributeValue("xmlns", rep);
  //this results an empty pageFooter
  </code></pre>
  
  <p>Any ideas? Thanks!!</p>