title: C# Change Namespace Prefix on Root Node of SyndicationItem
body: <p>Not even sure if I'm asking the right question, but here it goes. Basically because of a lack of support of the WCF DS client for "OData deep inserts" I'm having to manually build up an Atom request. I have the request nearly complete, the only thing that is missing (and it causing a problem on the request to the server) is add the namespace prefix to the "entry" node in the XML request.</p>
  
  <p>I'm using a SyndicationItem to build the request up. I need to prefix the "entry" node with "atom:" for the server to accept the request...</p>
  
  <p>Any help is much appreciated. Here is the request that is being generated now:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"&gt;
    &lt;atom:id&gt;uuid:8ed93950-9c16-4923-b6cc-ca5c7d020709;id=1&lt;/atom:id&gt;
    &lt;atom:title type="text"&gt;&lt;/atom:title&gt;
    &lt;atom:updated&gt;2011-11-03T23:02:40Z&lt;/atom:updated&gt;
    &lt;atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems" type="application/atom+xml;type=feed" title="SALES_ORDER.SalesOrderHeader_SalesOrderItemsx" href="SalesOrderHeaders()/SalesOrderItems"&gt;
      &lt;m:inline&gt;
        &lt;atom:feed&gt;
          &lt;atom:entry&gt;
            &lt;atom:content&gt;
              &lt;m:properties&gt;
                &lt;d:Item&gt;10&lt;/d:Item&gt;
                &lt;d:Material&gt;70000559&lt;/d:Material&gt;
                &lt;d:Plant&gt;570B&lt;/d:Plant&gt;
                &lt;d:Quantity&gt;10&lt;/d:Quantity&gt;
              &lt;/m:properties&gt;
            &lt;/atom:content&gt;
          &lt;/atom:entry&gt;
          &lt;atom:entry&gt;
            &lt;atom:content&gt;
              &lt;m:properties&gt;
                &lt;d:Item&gt;20&lt;/d:Item&gt;
                &lt;d:Material&gt;70000559&lt;/d:Material&gt;
                &lt;d:Plant&gt;570B&lt;/d:Plant&gt;
                &lt;d:Quantity&gt;10&lt;/d:Quantity&gt;
              &lt;/m:properties&gt;
            &lt;/atom:content&gt;
          &lt;/atom:entry&gt;
        &lt;/atom:feed&gt;
      &lt;/m:inline&gt;
    &lt;/atom:link&gt;
    &lt;atom:content type="text/xml"&gt;
      &lt;m:properties&gt;
        &lt;d:DocumentType&gt;ZCSH&lt;/d:DocumentType&gt;
        &lt;d:CustomerId&gt;0001008657&lt;/d:CustomerId&gt;
        &lt;d:SalesOrg&gt;1100&lt;/d:SalesOrg&gt;
        &lt;d:DistChannel&gt;10&lt;/d:DistChannel&gt;
        &lt;d:Division&gt;40&lt;/d:Division&gt;
      &lt;/m:properties&gt;
    &lt;/atom:content&gt;
  &lt;/entry&gt;
  </code></pre>
  
  <p>And here is the code I have right now to generate the request. This is just a proof of concept, so please ignore the crap. :)</p>
  
  <pre><code>XNamespace nsAtom = "http://www.w3.org/2005/Atom";
              XNamespace nsD = "http://schemas.microsoft.com/ado/2007/08/dataservices";
              XNamespace nsM = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
  
              SyndicationItem soHeader = new SyndicationItem();
  
              soHeader.AttributeExtensions.Add(new XmlQualifiedName("atom", XNamespace.Xmlns.ToString()), nsAtom.NamespaceName);
              soHeader.AttributeExtensions.Add(new XmlQualifiedName("d", XNamespace.Xmlns.ToString()), nsD.NamespaceName);
              soHeader.AttributeExtensions.Add(new XmlQualifiedName("m", XNamespace.Xmlns.ToString()), nsM.NamespaceName);
  
  
              soHeader.Content = SyndicationContent.CreateXmlContent(
                  new XElement(nsM + "properties",
                      new XElement(nsD + "DocumentType", "ZCSH"),
                      new XElement(nsD + "CustomerId", "0001008657"),
                      new XElement(nsD + "SalesOrg", "1100"),
                      new XElement(nsD + "DistChannel", "10"),
                      new XElement(nsD + "Division", "40")
                      )
                  );
  
              SyndicationLink link = SyndicationLink.CreateAlternateLink(new Uri("SalesOrderHeaders()/SalesOrderItems", UriKind.Relative), "application/atom+xml;type=feed");
              link.Title = "SALES_ORDER.SalesOrderHeader_SalesOrderItems";
              link.RelationshipType = "http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesOrderItems";
              soHeader.Links.Add(link);
  
              XElement items = new XElement(nsM + "inline",
                                  new XElement(nsAtom + "feed")
                                      );
  
              for (int i = 0; i &lt; 2; i++)
              {
                  items.Element(nsAtom + "feed").Add(new XElement(nsAtom + "entry",
                              new XElement(nsAtom + "content",
                                  new XElement(nsM + "properties",
                                      new XElement(nsD + "Item", ((i+1)*10).ToString()),
                                      new XElement(nsD + "Material", "70000559"),
                                      new XElement(nsD + "Plant", "570B"),
                                      new XElement(nsD + "Quantity", (Decimal)10.0)
                                      )
                                  )
                              )
                          );
              }
  
              link.ElementExtensions.Add(items);
  
              XmlWriter xml = XmlWriter.Create("C:\\test.xml");            
              soHeader.SaveAsAtom10(xml);
              xml.Close();
  </code></pre>