code: public XMLGregorianCalendar buildXMLGregorianCalendarDate(XMLGregorianCalendar cal) {
          XMLGregorianCalendar result = null;
          if (cal != null) {
              result = newXMLGregorianCalendar(cal.getDay(), cal.getMonth(), cal.getYear());
          }
          return result;
      }
docs: Create a XMLGregorianCalendar Without Time Component.
  
  @param cal a XMLGregorianCalendar, possibly with time information.
  @return An XMLGregorianCalendar