title: How do I serialize an object into an XDocument?
body: <p>I have a class that is marked with DataContract attributes and I would like to create an <code>XDocument</code> from objects of that class. Whats the best way of doing this?</p>
  <p>I can do it by going via an <code>XmlDocument</code> but this seems like an unnecessary step.</p>