title: Obtaining XmlElement from XDocument
body: <p>I have to pass a whole XML document into a 3rd party function. The parameter is <code>XmlElement</code>.</p>
  
  <p>To do this until now, I've successfully been using this:</p>
  
  <pre><code>XmlDocument doc;
  //doc = ...
  XmlElement root = doc.DocumentElement;
  3rdPartyFunction(root);
  </code></pre>
  
  <p>But now I'm using <code>XDocument</code> instead of <code>XmlDocument</code>:</p>
  
  <pre><code>XDocument doc;
  //doc = ...
  //how to call 3rdPartyFunction?
  </code></pre>
  
  <p>How do I call the function in this case? Can I convert from "Xml" to "X"?</p>