try {
JAXBContext ctx = JAXBContext.newInstance(QCRestException.class);
Unmarshaller marshaller = ctx.createUnmarshaller();
res = (QCRestException) marshaller.unmarshal(new StringReader(xml));
String errorMsg = res.getId() + ": " + res.getTitle();
throw new DefectTrackerFormatException(ex, errorMsg);
} catch (JAXBException e) {
throw new DefectTrackerFormatException(e, "Unable to parse XML response from server.");
}
}
}