public String getDocumentAsString(String docType, String patientId)
      throws InvalidTypeException, InvalidIdentifierException, DocumentBuilderException {

    POCDMT000040ClinicalDocument clinDoc = getDocument(docType, patientId);

    try {
      return XMLUtil.toCanonicalXMLString(clinDoc);
    } catch (JAXBException ex) {
      log.error(ex);
      throw new DocumentBuilderException(
          "Failed to convert POCDMT000040ClinicalDocument object to String.");
    }
  }