code: private void sendReport(HttpServletRequest req, HttpServletResponse resp, Map<String, Integer> errors)
      throws IOException {
  
          resp.setStatus(CmsWebdavStatus.SC_MULTI_STATUS);
  
          String absoluteUri = req.getRequestURI();
          String relativePath = getRelativePath(req);
  
          Document doc = DocumentHelper.createDocument();
          Element multiStatusElem = doc.addElement(new QName(TAG_MULTISTATUS, Namespace.get(DEFAULT_NAMESPACE)));
  
          Iterator<Entry<String, Integer>> it = errors.entrySet().iterator();
          while (it.hasNext()) {
              Entry<String, Integer> e = it.next();
              String errorPath = e.getKey();
              int errorCode = e.getValue().intValue();
  
              Element responseElem = addElement(multiStatusElem, TAG_RESPONSE);
  
              String toAppend = errorPath.substring(relativePath.length());
              if (!toAppend.startsWith("/")) {
                  toAppend = "/" + toAppend;
              }
              addElement(responseElem, TAG_HREF).addText(absoluteUri + toAppend);
              addElement(responseElem, TAG_STATUS).addText(
                  "HTTP/1.1 " + errorCode + " " + CmsWebdavStatus.getStatusText(errorCode));
          }
  
          Writer writer = resp.getWriter();
          doc.write(writer);
          writer.close();
      }
docs: Send a multistatus element containing a complete error report to the
  client.<p>
  
  @param req the servlet request we are processing
  @param resp the servlet response we are processing
  @param errors the errors to be displayed
  
  @throws IOException if errors while writing to response occurs