XMLSignature signature = new XMLSignature(document,org.apache.xml.security.utils.Constants.SignatureSpecNS,XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1);
Element soapHeader = getFirstChildElement(document.getDocumentElement());
soapHeader.appendChild(signature.getElement());
EbMSDataSourceResolver resolver = new EbMSDataSourceResolver(dataSources);
signature.getSignedInfo().addResourceResolver(resolver);
Transforms transforms = new Transforms(document);
transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
Element xpath = document.createElementNS(org.apache.xml.security.utils.Constants.SignatureSpecNS,org.apache.xml.security.utils.Constants._TAG_XPATH);