title: Convert JSON to XML using jQuery
body: <p>I need to convert JSON to XML (using jquery), but in this way:</p>
  
  <p>If I have JSON looking like this:</p>
  
  <pre><code>{
  name: "sampleConfiguration",
  description: "Configuration used for demonstration purposes"
  version: "1.0",
  parameters: [
      {
          name: "sampleParameter",
          description: "parameter description",
          value: "20",
          enabled: "1"
      },
      {
          name: "items",
          description: "parameter with subparameters",
          value:[
              {
                  name: "item",
                  description: "nested parameter",
                  value: "13"
              },
              {
                  name: "item",
                  description: "nested parameter 2",
                  value: "TEST"
              }
          ]
      }
  ]}
  </code></pre>
  
  <p>Then I should convert it to the XML looking like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;sampleConfiguration version="1.0" description="Configuration used for demonstration purposes"&gt;
  &lt;params&gt;
      &lt;sampleParameter enabled="1" description="parameter description"&gt;20&lt;/sampleParameter&gt;
      &lt;items description="parameter with subparameters"&gt;
          &lt;item description="nested parameter"&gt;13&lt;/item&gt;
          &lt;item description="nested parameter 2"&gt;TEST&lt;/item&gt;
      &lt;/items&gt;
  &lt;/params&gt;
  &lt;/sampleConfiguration&gt;
  </code></pre>
  
  <p>I have been looking for JSON to XML converting code, but I always get XML looking like this (which is what I don't need):</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;name&gt;sampleConfiguration&lt;/name&gt;
  &lt;description&gt;Configuration used for demonstration purposes&lt;/description&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;parameters&gt;
     &lt;name&gt;sampleParameter&lt;/name&gt;
     &lt;description&gt;parameter description&lt;/description&gt;
     &lt;value&gt;20&lt;/value&gt;
     &lt;enabled&gt;1&lt;/enabled&gt;
  &lt;/parameters&gt;
  &lt;parameters&gt;
     &lt;name&gt;items&lt;/name&gt;
     &lt;description&gt;parameter with subparameters&lt;/description&gt;
     &lt;value&gt;
        &lt;name&gt;item&lt;/name&gt;
        &lt;description&gt;nested parameter&lt;/description&gt;
        &lt;value&gt;13&lt;/value&gt;
     &lt;/value&gt;
     &lt;value&gt;
        &lt;name&gt;item&lt;/name&gt;
        &lt;description&gt;nested parameter 2&lt;/description&gt;
        &lt;value&gt;TEST&lt;/value&gt;
     &lt;/value&gt;
  &lt;/parameters&gt;
  </code></pre>