@Nullable public static XMLGregorianCalendar createXMLGregorianCalendar(){
  XMLGregorianCalendar result=null;
  try {
    DatatypeFactory datatypeFactory=DatatypeFactory.newInstance();
    TimeZone utc=TimeZone.getTimeZone("UTC");
    GregorianCalendar now=new GregorianCalendar(utc);
    result=datatypeFactory.newXMLGregorianCalendar(now);
  }
 catch (  DatatypeConfigurationException e) {
    throw new IMFException("Could not create a XMLGregorianCalendar instance");
  }
  return result;
}

@ Nullable public static XMLGregorianCalendar createXMLGregorianCalendar ( ) { XMLGregorianCalendar result = null ; try { DatatypeFactory datatypeFactory = DatatypeFactory . newInstance ( ) ; TimeZone utc = TimeZone . getTimeZone ( "UTC" ) ; GregorianCalendar now = new GregorianCalendar ( utc ) ; result = datatypeFactory . newXMLGregorianCalendar ( now ) ; } catch ( DatatypeConfigurationException e ) { throw new IMFException ( "Could not create a XMLGregorianCalendar instance" ) ; } return result ; }
a utility method to create an xmlgregoriancalendar
