title: Newtonsoft DeserializeXNode expands internal arrays incorrectly
body: <p>I have a JSON object like the following:</p>
  
  <pre><code>{
    "property1": "value1",
    "property2": "value2",
    "property3": ["value3","value4","value5"]
  }
  </code></pre>
  
  <p>When I try to use DeserializeXNode to convert to XML, though, the array goes away.</p>
  
  <pre><code>&lt;MyObj&gt;
      &lt;property1&gt;value1&lt;/property1&gt;
      &lt;property2&gt;value2&lt;/property2&gt;
      &lt;property3&gt;value3&lt;/property3&gt;
      &lt;property3&gt;value4&lt;/property3&gt;
      &lt;property3&gt;value5&lt;/property3&gt;
  &lt;/MyObj&gt;
  </code></pre>
  
  <p>This causes issue when I try to re-serialize back to the object, because I get a "cannot convert string to string[]" error. Moreover, when I try to parse the document, the duplicate properties are overwritten and only the last value remains. I've tried setting the third parameter of DeserializeXNode to true thinking that would mark the array properly, but that doesn't change anything.</p>
  
  <p>By my understanding from the Newtonsoft docs, the XML should look more like:</p>
  
  <pre><code>&lt;MyObj&gt;
      &lt;property1&gt;value1&lt;/property1&gt;
      &lt;property2&gt;value2&lt;/property2&gt;
      &lt;property3 type="array"&gt;
          &lt;item&gt;value3&lt;/item&gt;
          &lt;item&gt;value4&lt;/item&gt;
          &lt;item&gt;value5&lt;/item&gt;
      &lt;/property3&gt;
  &lt;/MyObj&gt;
  </code></pre>
  
  <p>What do I need to do to get the array to properly translate into the XML so that it will come back to JSON as an array?</p>
  
  <p>For reference, here is the code I'm using (inherited, so I'm not sure if it makes sense):</p>
  
  <p>ObjectToXML:</p>
  
  <pre><code>var json = JsonConvert.SerializeObject(o);
  var xdoc = JsonConvert.DeserializeXNode(json, "MyObj", true);
  return xdoc.ToString();
  </code></pre>
  
  <p>XMLToObject:</p>
  
  <pre><code>XDocument d = XDocument.Parse(xml, LoadOptions.None);
  d.Descendants().ForEach(e =&gt; e.Attributes().Remove());
  var json = JsonConvert.SerializeXNode(d);
  json = json.Replace("\"?xml\":{\"@version\":\"1.0\",\"@encoding\":\"utf-16\"},\"MyObj\":{", "")
      .Replace("{\"MyObj\":", "")
      .Replace("}}", "}")
      .Replace("{\"anyType\":", "")
      .Replace("]}", "]");
  return JsonConvert.DeserializeObject&lt;T&gt;(json);
  </code></pre>
  
  <p>And the object itself:</p>
  
  <pre><code>public class MyObj
  {
      public string property1 { get; set; }
      public string property2 { get; set; }
      public string[] property3 { get; set; }
  }
  </code></pre>