class RegistrationDateAdapter extends XmlAdapter<String, XMLGregorianCalendar> {

    @Override
    public String marshal(XMLGregorianCalendar xmlGregorianCalendar) throws Exception
    {
        try
        {
            return xmlGregorianCalendar.toXMLFormat();
        }
        catch (Exception e)
        {
            throw new Exception("Error marshaling response.", e);
        }
    }

}