title: Convert Calendar to XMLGregorianCalendar with specific formatting
body: <p>I am having some issues in converting a calendar object to an XMLGregorian calendar in the format of <code>YYYY-MM-DD HH:mm:ss</code>. </p>
  
  <p>My current code is: </p>
  
  <pre><code>Calendar createDate = tRow.getBasic().getDateCreated(0).getSearchValue();
  Date cDate = createDate.getTime();
  GregorianCalendar c = new GregorianCalendar();
  c.setTime(cDate);
  XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
  </code></pre>
  
  <p>which returns a date of <code>2013-01-03T11:50:00.000-05:00</code>.</p>
  
  <p>I would like it to read <code>2013-01-03 11:50:00</code>.</p>
  
  <p>I have checked a bunch of posts, which use DateFormat to parse a string representation of the date, however my dates are provided to me as a Calendar object, not a string. </p>
  
  <p>I'd appreciate a nudge in the right direction to help me figure this one out. </p>