public Assertion build(Element element, AssertionBuilderFactory factory) throws IllegalArgumentException {
final SPConstants.SPVersion spVersion = SPConstants.SPVersion.getSPVersion(element.getNamespaceURI());
boolean body = SPUtils.hasChildElementWithName(element, spVersion.getSPConstants().getBody());
final List<Header> headers = getHeaders(element, true, spVersion);
final Attachments attachments = getAttachments(element, spVersion);
final boolean signAllHeaders = !SPUtils.hasChildElements(element);
body |= signAllHeaders;
SignedParts signedParts = new SignedParts(spVersion, body, attachments, headers, signAllHeaders);
signedParts.setOptional(SPUtils.isOptional(element));
signedParts.setIgnorable(SPUtils.isIgnorable(element));