title: Convert JSON into XML using Java
body: <p>I'm trying to convert JSON into XML. But I'm getting an error that org.json cannot be resolved. I have also imported the external jar file java-json.jar. Below is my java code:</p>
  
  <pre><code>import org.json.JSONObject;
  public class JsontoXML{
    public static void main(String args[])
    {
      String str ={'name':'JSON','integer':1,'double':2.0,'boolean':true,'nested' {'id':42},'array':[1,2,3]}"; 
      JSONObject json = new JSONObject(str);
      String xml = XML.toString(json);
      System.out.println(xml);
  
    }
  </code></pre>
  
  <p>}</p>