encryptionPart.setElement(element);
Document doc = element.getOwnerDocument();
doc.appendChild(element);
builder.prepare(element.getOwnerDocument(), stsProperties.getEncryptionCrypto());
builder.encryptForRef(null, Collections.singletonList(encryptionPart));
return doc.getDocumentElement();
}