code: @Nullable
    public static XMLGregorianCalendar getXMLCalendar (@Nullable final XMLGregorianCalendar aDate,
                                                       @Nullable final XMLGregorianCalendar aTime)
    {
      if (aDate == null && aTime == null)
        return null;
      if (aTime == null)
      {
        // Date only
        return s_aDTFactory.newXMLGregorianCalendar (aDate.getYear (),
                                                     aDate.getMonth (),
                                                     aDate.getDay (),
                                                     0,
                                                     0,
                                                     0,
                                                     0,
                                                     aDate.getTimezone ());
      }
      if (aDate == null)
      {
        // Time only
        return s_aDTFactory.newXMLGregorianCalendar (0,
                                                     0,
                                                     0,
                                                     aTime.getHour (),
                                                     aTime.getMinute (),
                                                     aTime.getSecond (),
                                                     aTime.getMillisecond (),
                                                     aTime.getTimezone ());
      }
  
      if (aDate.getTimezone () != aTime.getTimezone ())
        LOGGER.warn ("Date and time have different timezones: " + aDate.getTimezone () + " vs. " + aTime.getTimezone ());
      return s_aDTFactory.newXMLGregorianCalendar (aDate.getYear (),
                                                   aDate.getMonth (),
                                                   aDate.getDay (),
                                                   aTime.getHour (),
                                                   aTime.getMinute (),
                                                   aTime.getSecond (),
                                                   aTime.getMillisecond (),
                                                   aDate.getTimezone ());
    }
docs: Create a new {@link XMLGregorianCalendar} using separate objects for date
  and time.
  
  @param aDate
  Source date. May be <code>null</code>.
  @param aTime
  Source time. May be <code>null</code>.
  @return <code>null</code> if the passed date and time are <code>null</code>
  .