title: JSONObject xml conversion error for epoch time
body: <p>I am writing a program to Convert JSON content which contains epoch time in one of the attribute to XML format and to store it in a string.</p>
  
  <p>Below is the code</p>
  
  <pre><code>String data = "{\"result\":\"pass\", \"timestamp\":1497870880.0396869183}";
  JSONObject json = new JSONObject(data); //the json object contains proper epoch value after this line
  String event = XML.toString(json); 
  </code></pre>
  
  <p>When i print the content of the string event i get</p>
  
  <pre><code>&lt;result&gt;pass&lt;/result&gt;&lt;timestamp&gt;1.497870880039687E9&lt;/timestamp&gt;
  </code></pre>
  
  <p>the value of timestamp is changed.</p>
  
  <p>But if the JSON content has the epoch timestamp as string, like</p>
  
  <pre><code>String data = "{\"result\":\"pass\", \"timestamp\":"1497870880.0396869183"}";
  </code></pre>
  
  <p>Then the resultant event string gives proper result</p>
  
  <pre><code>&lt;result&gt;pass&lt;/result&gt;&lt;timestamp&gt;1497870880.0396869183&lt;/timestamp&gt;
  </code></pre>
  
  <p>Can anybody please explain why this is happening? Is the JSON XML API not friendly with the LONG values ?
  Note: the input JSON content would contain multiple attributes with string values as well as epoch time.</p>