code: public static Calendar parseXmlDate(String xsDate) throws ParseException {
          try {
              DatatypeFactory df = DatatypeFactory.newInstance();
              XMLGregorianCalendar dateTime = df.newXMLGregorianCalendar(xsDate);
              return dateTime.toGregorianCalendar();
          } catch (DatatypeConfigurationException ex) {
              throw new ParseException("Unable to parse " + xsDate, ex);
          }
      }
docs: Parses an XML xs:date into a calendar object.
  @param xsDate an xs:date string
  @return a calendar object
  @throws ParseException thrown if the date cannot be converted to a calendar