title: Converting Java.util date to XML date in format YYYY-MMM-dd
body: <p>I'm using below code to convert java.util.date to XML date</p>
  
  <pre><code>public static XMLGregorianCalendar toXMLDate(Date dte) {
      try {
  
          // this may throw DatatypeConfigurationException
                      DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
                      GregorianCalendar calendar = new GregorianCalendar();
                      // reset all fields
                      calendar.clear();
  
          Calendar parsedCalendar = Calendar.getInstance();
          parsedCalendar.setTime(dte);
          calendar.set( parsedCalendar.get(Calendar.YEAR ), 
                                   parsedCalendar.get(Calendar.MONTH),
                                   parsedCalendar.get(Calendar.DATE ));
          XMLGregorianCalendar xmlCalendar = datatypeFactory.newXMLGregorianCalendar( calendar );
          xmlCalendar.setTimezone( DatatypeConstants.FIELD_UNDEFINED );
          xmlCalendar.setFractionalSecond( null );
          return xmlCalendar;
  </code></pre>
  
  <p>}</p>
  
  <p>I need to get the date in the format YYYY-MMM-dd, but it returns in a format YYYY-MM-dd.
  Can anyone tell me how can i change the format?
  Thanks</p>