I created a XDocument element which shows exactly the XML that I need if I call the ToString() method.
Now I need to create a WEB API controller method to enable myself to call the controller and get exactly the XML of the XDocument.
I get an
"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'."
error if I try something like this:
// GET api/values
public XDocument Get()
XDocument doc = new XDocument();
<filling the XDocument>
How can I get this to work?