HashMap<String, String> extractMessageElements = new HashMap<String, String>();
extractMessageElements.put("root.element.sub-elementA.attribute", "${valueA}");
extractMessageElements.put("root.element.sub-elementB.attribute", "${valueB}");
XpathPayloadVariableExtractor variableExtractor = new XpathPayloadVariableExtractor();
variableExtractor.setxPathExpressions(extractMessageElements);
receiveMessageBean.addVariableExtractors(variableExtractor);
List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
validationContexts.add(validationContext);