code: static XMLObject unmarshallMessage(ParserPool parserPool, InputStream messageStream)
          throws ClientProtocolException
      {
          try {
              Document messageDoc = parserPool.parse(messageStream);
              Element messageElem = messageDoc.getDocumentElement();
  
              Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(
                      messageElem);
              if (unmarshaller == null) {
                  throw new ClientProtocolException(
                          "Unable to unmarshall message, no unmarshaller registered for message element "
                                  + XMLHelper.getNodeQName(messageElem));
              }
  
              XMLObject message = unmarshaller.unmarshall(messageElem);
  
              return message;
          }
          catch (XMLParserException e) {
              throw new ClientProtocolException(
                      "Encountered error parsing message into its DOM representation", e);
          }
          catch (UnmarshallingException e) {
              throw new ClientProtocolException(
                      "Encountered error unmarshalling message from its DOM representation", e);
          }
      }
docs: Helper method that deserializes and unmarshalls the message from the given stream. This
  method has been adapted from {@code org.opensaml.ws.message.decoder.BaseMessageDecoder}.
  
  @param messageStream
  input stream containing the message
  
  @return the inbound message
  
  @throws MessageDecodingException
  thrown if there is a problem deserializing and unmarshalling the message