PrintWriter pw = response.getWriter();
// if doing a single pid/datastream, simple xml output
if (singlePID && datastreams.length == 1) {
response.setContentType("text/xml; charset=UTF-8");
Date[] versions = apimDefault.modifyDatastreamControlGroup(context, pid, dsID, controlGroup, addXMLHeader, reformat, setMIMETypeCharset);
pw.write("<versions>\n");
for (Date version : versions) {
pw.write("<version>" + version.toString() + "</version>\n");
}
pw.write("</versions>\n");