java.util.date - converting XMLGregorianCalendar object in String format to XMLGregorianCalendar object again

I have converted an XMLGregorianCalendar object to String using toString() method. So in a String variable I have "2014-09-02T10:55:58.000+05:30" . Now I want to load this value to an XMLGregorianCalendar object again. GregorianCalendar cal = new GregorianCalendar(); cal.setTime(new Date()); XMLGregorianCalendar xgcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); System.out.println(xgcal); String strDate = xgcal.toString(); System.out.println("In String format "+strDate);I want to store this ...Read more