EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());
assertEquals("http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey", requestToken.getKeyType().toASCIIString());
UseKeyType useKeyType = requestToken.getUseKey();
Element certEl = (Element) useKeyType.getAny().get(0);
assertEquals("ds:" + WSTRequestSecurityTokenParser.X509CERTIFICATE, certEl.getTagName());
// Now for the writing part
ByteArrayOutputStream baos = new ByteArrayOutputStream();