Sample 1. Print Marshaled XML for the Entity object
Employee employee = new Employee()
.withEmployeeId(123)
.withDeptId(456)
.build();
JAXBContext context = JAXBContext.newInstance(Employee.class);
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(employee, System.out); // prints XML for the object