code: public JSON read( String xml ) {
        JSON json = null;
        try{
           Document doc = new Builder().build( new StringReader( xml ) );
           Element root = doc.getRootElement();
           if( isNullObject( root ) ){
              return JSONNull.getInstance();
           }
           String defaultType = getType( root, JSONTypes.STRING );
           if( isArray( root, true ) ){
              json = processArrayElement( root, defaultType );
              if( forceTopLevelObject ){
                 String key = removeNamespacePrefix( root.getQualifiedName() );
                 json = new JSONObject().element( key, json );
              }
           }else{
              json = processObjectElement( root, defaultType );
              if( forceTopLevelObject ){
                 String key = removeNamespacePrefix( root.getQualifiedName() );
                 json = new JSONObject().element( key, json );
              }
           }
        }catch( JSONException jsone ){
           throw jsone;
        }catch( Exception e ){
           throw new JSONException( e );
        }
        return json;
     }
docs: Creates a JSON value from a XML string.
  
  @param xml A well-formed xml document in a String
  @return a JSONNull, JSONObject or JSONArray
  @throws JSONException if the conversion from XML to JSON can't be made for
  I/O or format reasons.