// Create new Conditions & sign the Assertion
createNewConditions(assertion, tokenParameters);
signAssertion(assertion, tokenParameters);
Document doc = DOMUtils.createDocument();
Element token = assertion.toDOM(doc);
if (assertion.getSaml1() != null) {
token.setIdAttributeNS(null, "AssertionID", true);
} else {
token.setIdAttributeNS(null, "ID", true);
}