title: XDocument to JSON, JsonProperties
body: <p>I am working with C# (ASP.Net, MVC) and Newtonsoft for JSON serialization. I get an XDocument like the one below which I would like to have in JSON format, for the view.</p>
  
  <pre><code>&lt;group&gt;
    &lt;name&gt;Group 1&lt;/name&gt;
    &lt;description&gt;&lt;p&gt;Description&lt;/p&gt;&lt;/description&gt;
    &lt;section&gt;
      ..
    &lt;/section&gt;
    &lt;section&gt;
      ..
    &lt;/section&gt;
  &lt;/group&gt;
  </code></pre>
  
  <p>I have an Extension like this</p>
  
  <pre><code>private static readonly JsonSerializer jSerializer = JsonSerializer.Create(new JsonSerializerSettings {});
  
  public static string ToJson(this object obj) {
    using (StringWriter writer = new StringWriter()) {
      jSerializer.Serialize(writer, obj);
      return writer.ToString();
    }
  }
  </code></pre>
  
  <p>The problem now is, that the description gets deserialized, so I have something like</p>
  
  <pre><code>... "description": { "p": "Description Text" }
  </code></pre>
  
  <p>which will be displayed as "[Object object]" when just posted as is.</p>
  
  <ul>
  <li>Is there a way to set some JsonProperties for the XDocument (in general), without generating a completely deserialized class?</li>
  <li>If not, is there a way to set some JsonProperty saying "Keep this as string, do not serialize any further"</li>
  <li>If I were to use an XSD generated class for this, what "type" would I need to set? "anyType"?</li>
  </ul>
  
  <p>Help would be appreciated,
  Best regards.</p>