}
private Attribute getSAML2Attribute(String name, String value, String namespace) {
XMLObjectBuilderFactory builderFactory = null;
SAMLObjectBuilder<Attribute> attrBuilder = null;
Attribute attribute = null;
XSStringBuilder attributeValueBuilder = null;
XSString stringValue = null;
builderFactory = Configuration.getBuilderFactory();
attrBuilder = (SAMLObjectBuilder<Attribute>) builderFactory
.getBuilder(Attribute.DEFAULT_ELEMENT_NAME);
attribute = attrBuilder.buildObject();
attribute.setName(name);
attribute.setNameFormat(namespace);
attributeValueBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);
stringValue = attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME,
XSString.TYPE_NAME);
stringValue.setValue(value);
attribute.getAttributeValues().add(stringValue);
return attribute;
}