public byte[] getDocumentAsBytes(String docType, String patientId) throws InvalidTypeException, InvalidIdentifierException, DocumentBuilderException { POCDMT000040ClinicalDocument clinDoc = getDocument(docType, patientId); try { return XMLUtil.toCanonicalXMLBytes(clinDoc); } catch (JAXBException ex) { log.error(ex); throw new DocumentBuilderException( "Failed to convert POCDMT000040ClinicalDocument object to String."); } }