code: public XMLGregorianCalendar newXMLGregorianCalendarTime(
              final int hours,
              final int minutes,
              final int seconds,
              final int milliseconds,
              final int timezone) {
  
          // millisecond may be undefined
          // millisecond must be >= 0 millisecond <= 1000
          BigDecimal realMilliseconds = null; // undefined value
          if (milliseconds != DatatypeConstants.FIELD_UNDEFINED) {
              if (milliseconds < 0 || milliseconds > 1000) {
                  throw new IllegalArgumentException(
                          "javax.xml.datatype.DatatypeFactory#newXMLGregorianCalendarTime("
                          + "int hours, int minutes, int seconds, int milliseconds, int timezone)"
                          + "with invalid milliseconds: " + milliseconds
                  );
              }
              realMilliseconds = BigDecimal.valueOf((long) milliseconds, 3);
          }
  
          return newXMLGregorianCalendarTime(
                  hours,
                  minutes,
                  seconds,
                  realMilliseconds,
                  timezone
          );
      }
docs: <p>Create a Java instance of XML Schema builtin datatype time.</p>
  
  <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
  
  @param hours number of hours
  @param minutes number of minutes
  @param seconds number of seconds
  @param milliseconds number of milliseconds
  @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
  
  @return <code>XMLGregorianCalendar</code> created from parameter values.
  
  @see DatatypeConstants#FIELD_UNDEFINED
  
  @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
  as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
  or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
  as determined by {@link XMLGregorianCalendar#isValid()}.