title: JSON.Net Xml Serialization misunderstands arrays
body: <p>I have some autogenerated xmls where some parts of the xml may have multiple rows and some may not. The result is that if there is one row a single json node is returned and if I have multiple rows an array with json nodes are returned.</p>
  
  <p>The xmls may look like this </p>
  
  <pre><code>&lt;List&gt;
      &lt;Content&gt;
          &lt;Row Index="0"&gt;
              &lt;Title&gt;Testing&lt;/Title&gt;
              &lt;PercentComplete&gt;0&lt;/PercentComplete&gt;
              &lt;DueDate/&gt;
              &lt;StartDate/&gt;
          &lt;/Row&gt;
      &lt;/Content&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>Or with multiple rows</p>
  
  <pre><code>&lt;List&gt;
      &lt;Content&gt;
          &lt;Row Index="0"&gt;
              &lt;Title&gt;Update Documentation&lt;/Title&gt;
              &lt;PercentComplete&gt;0.5&lt;/PercentComplete&gt;
              &lt;DueDate&gt;2013-01-31 00:00:00&lt;/DueDate&gt;
              &lt;StartDate&gt;2013-01-01 00:00:00&lt;/StartDate&gt;
          &lt;/Row&gt;
          &lt;Row Index="1"&gt;
              &lt;Title&gt;Write jQuery example&lt;/Title&gt;
              &lt;PercentComplete&gt;0.05&lt;/PercentComplete&gt;
              &lt;DueDate&gt;2013-06-30 00:00:00&lt;/DueDate&gt;
              &lt;StartDate&gt;2013-01-02 00:00:00&lt;/StartDate&gt;
          &lt;/Row&gt;
      &lt;/Content&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>When serializing these to JSON using</p>
  
  <pre><code>JsonConvert.SerializeXmlNode(xmldoc, Formatting.Indented);
  </code></pre>
  
  <p>The first xml becomes this</p>
  
  <pre><code>{
      "List": {
          "Content": {
              "Row": {
                  "@Index": "0",
                  "Title": "Testing",
                  "PercentComplete": "0",
                  "DueDate": null,
                  "StartDate": null
              }
          }
      }
  }
  </code></pre>
  
  <p>And the second this</p>
  
  <pre><code>{
      "List": {
          "Content": {
              "Row": [{
                  "@Index": "0",
                  "Title": "Update Documentation",
                  "PercentComplete": "0.5",
                  "DueDate": "2013-01-31 00:00:00",
                  "StartDate": "2013-01-01 00:00:00"
              }, {
                  "@Index": "1",
                  "Title": "Write jQuery example",
                  "PercentComplete": "0.05",
                  "DueDate": "2013-06-30 00:00:00",
                  "StartDate": "2013-01-02 00:00:00"
              }]
          }
      }
  }
  </code></pre>
  
  <p>As clearly can be seen the Row on the second one is an array as should be but not on the first one. Is there any known workaround on this kind of issues or do I need to implement the check in my frontend receiving the JSON (that would be a bit problematic since the structures are very dynamic). The best way would be if there where any way to enforce json.net to always return arrays.</p>