/* Create the content: */
DigitalObjectContent c1 = Content.byReference(purl.toURL());
/* Given these, we can instantiate our object: */
DigitalObject object = new DigitalObject.Builder(digitalObject).permanentUri(pdURI).content(c1).build();
OutputStream outStream = new FileOutputStream(doMetadata);
outStream.write(object.toXml().getBytes());
outStream.close();
} catch (UnsupportedEncodingException e) {
log.severe("Unsupported encodeing exception");
log.severe(e.getMessage());
log.severe(e.getStackTrace().toString());