title: How to cause a JSON property to be converted to XML as an attribute of an xml-element
body: <p>Using Newtonsoft's .Net Library to convert JSON to XML, is there a way to convert a specific JSON element to an XML attribute?</p>
  
  <p>For example, taking the following JSON:</p>
  
  <pre><code>{
      "array": {
          "item": [
              1,
              2,
              3
          ],
          "length": 3
      }
  }
  </code></pre>
  
  <p>and converting it to:</p>
  
  <pre><code>&lt;array length="3"&gt;
      &lt;item&gt;1&lt;/item&gt;
      &lt;item&gt;2&lt;/item&gt;
      &lt;item&gt;3&lt;/item&gt;
  &lt;/array&gt;
  </code></pre>
  
  <p>Thanks.</p>