title: Unable to convert XML string containing '&' or ';' to JSON object
body: <p>I want to convert XML String to a JSON object.</p>
  
  <p>Below is the XML:</p>
  
  <pre><code>&lt;request&gt;
      &lt;Products&gt;
          &lt;Product&gt;
              &lt;ProductName&gt;H &amp;amp; M&lt;/ProductName&gt;
              &lt;quantity&gt;1&lt;/quantity&gt;
              &lt;totalProductCost&gt;17.03&lt;/totalProductCost&gt;
          &lt;/Product&gt;
      &lt;/Products&gt;
  &lt;/request&gt;
  </code></pre>
  
  <p>This XML string comes as a request parameter.
  <code>httpReqMap</code> is the map containing request parameters and their values.
  When I execute this statement </p>
  
  <pre><code>String reqstring = httpReqMap.get("request");
  </code></pre>
  
  <p>breaks the XML string in 2 parts. Thus the XML is invalid and I am unable to convert it to JSON Object.</p>
  
  <p>I have tried to pass '&amp;' as '&amp;amp;'.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>String reqstring = httpReqMap.get("request");
  JSONObject jsonObject = XML.toJSONObject(httpReqMap.get("request"));
  </code></pre>
  
  <p>It should escape special character and convert XML to JSON.</p>