code: private String getClientData(BufferedReader inFromClient) {
      StringBuilder stringFromClient = new StringBuilder();
      try {
        String line;
        while ((line = inFromClient.readLine()) != null) {
          if (line.matches("<ENDOFDOCUMENT>")) {
            break;
          }
          stringFromClient.append(line).append("\n");
          if (line.matches("</NAF>")) {
            break;
          }
        }
      } catch (IOException e) {
        e.printStackTrace();
      }
      return stringFromClient.toString();
    }
docs: Read data from the client and output to a String.
  
  @param inFromClient
  the client inputstream
  @return the string from the client