Here you can find the source of getXMLCurrentTime()
public static XMLGregorianCalendar getXMLCurrentTime() throws DatatypeConfigurationException
//package com.java2s; import java.util.GregorianCalendar; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; public class Main { public static XMLGregorianCalendar getXMLCurrentTime() throws DatatypeConfigurationException { GregorianCalendar gcal = new GregorianCalendar(); XMLGregorianCalendar xcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal); return xcal; }/*from w w w . j a v a 2 s. co m*/ }