Adding XML elements in the right order
<p>I want to add elements to the <a href="https://msdn.microsoft.com/de-de/library/system.xml.linq.xdocument%28v=vs.110%29.aspx" rel="nofollow">XDocument</a> object and the order of the elements for that XML I want to build is defined in a XSD e.g.</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="Address"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="Recipient"/&gt;
        &lt;xs:element name="City"/&gt;
     &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
</code></pre>

<p>Now I want to add the following two XElements   </p>

<pre><code>XDocument doc = new XDocument(new XElement("Address"));
doc.Root.Add(new XElement("City"));
doc.Root.Add(new XElement("Recipient"));
</code></pre>

<p>Can does XDocument automatically bring the elements into the right order by reference to the xsd? So if I write the XDocument to string the element Recipient should written first and then the element City.</p>