title: How to use of XmlGregorianCalendar with fromJson and toJson methods of gson?
body: <p>The theme of my project is to give XML format of data and get Json format using google-gson and I have JAXB generated java POJOs from XML schema in which I have a variable of XMLGregorianCalendar datatype.</p>
  
  <p>I give the following input of XML and get the json format from the gson.toJson() method;</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;EmpRequest xmlns="http://java.com/Employee"&gt;
  &lt;EmplIn&gt;
  &lt;EmpID&gt;12&lt;/EmpID&gt;
  &lt;Empname&gt;sara&lt;/Empname&gt;
  &lt;Designation&gt;SA&lt;/Designation&gt;
  &lt;DOJ&gt;2002-05-30T09:30:10+06:00&lt;/DOJ&gt;
  &lt;/EmplIn&gt;
  &lt;/EmpRequest&gt;
  </code></pre>
  
  <p>But in the output, I got the following.</p>
  
  <pre><code>{"emplIn":{"empID":"12","empname":"sara","designation":"SA","doj":{}}}
  </code></pre>
  
  <p>I surfed google and got the suggestion of adding  in the xml schema and changing the XmlGregorianCalendar datatype with string. But I dont want to achieve it from both the ways.</p>
  
  <p>I mean how to get the proper output with the XmlGregorianCalendar datatype through fromJson and toJson methods of gson?</p>
  
  <p>Thank you so much,
  Harish Raj.</p>