XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
SAMLObjectBuilder<Artifact> artifactBuilder = (SAMLObjectBuilder<Artifact>) builderFactory.getBuilder(Artifact.DEFAULT_ELEMENT_NAME);
SAMLObjectBuilder<ArtifactResolve> artifactResolveBuilder = (SAMLObjectBuilder<ArtifactResolve>) builderFactory.getBuilder(ArtifactResolve.DEFAULT_ELEMENT_NAME);
Artifact artifact = artifactBuilder.buildObject();
artifact.setArtifact(artifactId);
ArtifactResolve artifactResolve = artifactResolveBuilder.buildObject();
artifactResolve.setArtifact(artifact);
buildCommonAttributes(context.getLocalEntityId(), artifactResolve, endpoint);