Refer below..
private Date toDate(XMLGregorianCalendar calendar){
if(calendar == null) {
return null;
}
java.util.Date dt = calendar.toGregorianCalendar().getTime();
java.sql.Date sqlDt = new java.sql.Date(dt.getTime());
return sqlDt;
}