Here you can find the source of getNextMonthDate(GregorianCalendar calendar)
public static XMLGregorianCalendar getNextMonthDate(GregorianCalendar calendar) throws Exception
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.GregorianCalendar; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; public class Main { public static XMLGregorianCalendar getNextMonthDate(GregorianCalendar calendar) throws Exception { DatatypeFactory df = DatatypeFactory.newInstance(); GregorianCalendar aCal = (GregorianCalendar) calendar.clone(); aCal.add(Calendar.MONTH, 1); return df.newXMLGregorianCalendar(aCal); }//from w w w . java 2 s . c o m public static XMLGregorianCalendar getNextMonthDate() throws Exception { return getNextMonthDate(new GregorianCalendar()); } }