code: private String getResourceId(String response, String resourceResponseAction, String resourceIdXpath, String resourceIdExceptionMessage) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
          if (WSManUtils.isSpecificResponseAction(response, resourceResponseAction)) {
              String shellId = XMLUtils.parseXml(response, resourceIdXpath);
              if (StringUtils.isNotBlank(shellId)) {
                  return shellId;
              } else {
                  throw new RuntimeException(resourceIdExceptionMessage);
              }
          } else if (WSManUtils.isFaultResponse(response)) {
              throw new RuntimeException(WSManUtils.getResponseFault(response));
          } else {
              throw new RuntimeException(UNEXPECTED_SERVICE_RESPONSE + response);
          }
      }
docs: This method retrieves the resource id from the create resource request response and throws the appropriate exceptions in case of failure.
  
  @param response
  @param resourceResponseAction
  @param resourceIdXpath
  @param resourceIdExceptionMessage
  @return
  @throws ParserConfigurationException
  @throws SAXException
  @throws XPathExpressionException
  @throws IOException