code: public XMLGregorianCalendar buildXMLGregorianCalendarDate(Calendar cal) {
          XMLGregorianCalendar result = null;
          if (cal != null) {
              result = newXMLGregorianCalendar(cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.MONTH) + 1,
                      cal.get(Calendar.YEAR));
          }
          return result;
      }
docs: Create a XMLGregorianCalendar Without Time Component.
  
  @param cal The initial Calendar
  @return An XMLGregorianCalendar