title: Converting JSON to XML in Java
body: <p>I am new to json. I am having a program to generate xml from json object. </p>
  
  <pre><code>String str = "{'name':'JSON','integer':1,'double':2.0,'boolean':true,'nested':{'id':42},'array':[1,2,3]}";  
      JSON json = JSONSerializer.toJSON( str );  
      XMLSerializer xmlSerializer = new XMLSerializer();  
      xmlSerializer.setTypeHintsCompatibility( false );  
      String xml = xmlSerializer.write( json );  
      System.out.println(xml); 
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;o&gt;&lt;array json_class="array"&gt;&lt;e json_type="number"&gt;1&lt;/e&gt;&lt;e json_type="number"&gt;2&lt;/e&gt;&lt;e json_type="number"&gt;3&lt;/e&gt;&lt;/array&gt;&lt;boolean json_type="boolean"&gt;true&lt;/boolean&gt;&lt;double json_type="number"&gt;2.0&lt;/double&gt;&lt;integer json_type="number"&gt;1&lt;/integer&gt;&lt;name json_type="string"&gt;JSON&lt;/name&gt;&lt;nested json_class="object"&gt;&lt;id json_type="number"&gt;42&lt;/id&gt;&lt;/nested&gt;&lt;/o&gt;
  </code></pre>
  
  <p>my biggest problem is how to write my own attributes instead of json_type="number" and also writing my own sub elements like . </p>