title: How do I add a document type to an XDocument?
body: <p>I have an existing XDocument object that I would like to add an XML doctype to.  For example:</p>
  
  <pre><code>XDocument doc = XDocument.Parse("&lt;a&gt;test&lt;/a&gt;");
  </code></pre>
  
  <p>I can create an XDocumentType using:</p>
  
  <pre><code>XDocumentType doctype = new XDocumentType("a", "-//TEST//", "test.dtd", "");
  </code></pre>
  
  <p>But how do I apply that to the existing XDocument?</p>