if (!(value instanceof SecurityTokenMessage))
throw new IOException("Can't serialize a " + value.getClass().getName() + " with a SecurityTokenMessageSerializer.");
context.setPretty(false);
SecurityTokenMessage tokenRequest = (SecurityTokenMessage) value;
try {
Element element = tokenRequest.getElement();
if (name.equals(new QName(element.getNamespaceURI(), element.getLocalName()))) {
AttributesImpl attrs = null;
if (attributes != null)
attrs = new AttributesImpl(attributes);
else