code: public void processResults(Document document) throws Throwable {
      Element root = document.getDocumentElement();
      root.normalize();
      
      // top element should testcase which has attributes for the outcome of the test
      // e.g <testcase classname="TheClass" name="theName(TheClass)" status="Error"><exception message="message" type="type">some text</exception></testcase>
      NamedNodeMap attributes = root.getAttributes();
      String statusAsStr = attributes.getNamedItem("status").getNodeValue();
      Status status = Status.valueOf(statusAsStr);
      if (status.equals(Status.Error) || status.equals(Status.Failure)) {
        throw getException(root, status);
      }
    }
docs: Processes the actual XML result and generate exceptions in case there was
  an issue on the server side.
  
  @param document
  @throws Throwable