Here you can find the source of getXMLDate()
public static XMLGregorianCalendar getXMLDate()
//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 { /**// www . ja v a 2s .c om * @return An instance of XMLGregorianCalendar set to the current date. */ public static XMLGregorianCalendar getXMLDate() { GregorianCalendar cal = new GregorianCalendar(); XMLGregorianCalendar sample; XMLGregorianCalendar result; try { sample = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); result = DatatypeFactory.newInstance().newXMLGregorianCalendar(); result.clear(); result.setMonth(sample.getMonth()); result.setYear(sample.getYear()); result.setDay(sample.getDay()); return result; } catch (DatatypeConfigurationException e1) { return null; } } }