EntityDescriptorType entityDescriptor = metaDataFactory.createEntityDescriptorType();
entityDescriptor.setEntityID(getEntityId());
entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().add(idpSsoDescriptor);
Marshaller marshaller = metaDataJaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(metaDataFactory.createEntityDescriptor(entityDescriptor), writer);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}