/**
   * Modify and Existing Message processor based on the given XML that is passed from the FE
   *
   * @param xml XML configuration for the changed Message processor
   * @throws AxisFault if Some thing goes wrong when modifying the Message processor
   */
  public void modifyMessageProcessor(String xml) throws AxisFault {
    try {
      OMElement msElem = createElement(xml);
      MessageProcessor messageProcessor = MessageProcessorFactory.createMessageProcessor(msElem);
      if (messageProcessor != null && messageProcessor.getName() != null) {
        SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
        MessageProcessor removedProcessor =
            synapseConfiguration.removeMessageProcessor(messageProcessor.getName());
        if (removedProcessor != null) {
          removedProcessor.destroy();
        }
        messageProcessor.init(getSynapseEnvironment());
        String fileName = ServiceBusUtils.generateFileName(messageProcessor.getName());
        messageProcessor.setFileName(fileName);
        synapseConfiguration.addMessageProcessor(messageProcessor.getName(), messageProcessor);
        MediationPersistenceManager mp = getMediationPersistenceManager();
        mp.saveItem(messageProcessor.getName(), ServiceBusConstants.ITEM_TYPE_MESSAGE_PROCESSOR);
      } else {
        String message = "Unable to Update Message Processor ";
        handleException(log, message, null);
      }

    } catch (XMLStreamException e) {
      String message = "Unable to Modify Message Processor ";
      handleException(log, message, e);
    }
  }