private void recvBean(Source source) throws Exception { System.out.println("**** recvBean ******"); JAXBElement element = (JAXBElement) jaxbContext.createUnmarshaller().unmarshal(source); System.out.println("name=" + element.getName() + " value=" + element.getValue()); if (element.getValue() instanceof SayHello) { SayHello hello = (SayHello) element.getValue(); System.out.println("Say Hello from " + hello.getArg0()); } }