To marshal an existing JAXB class object, drag and drop the JAXB Marshal palette icon to IDE editor.
The Generate JAXB Marshal codedialog box is displayed.
Enter the JAXB object's class name or use the Find... button to search for the class. (as in the Construct's Figure 1–3section)
Select the Marshal To option. You can generate the code from a marshal JAXB object to one of String, Writer, OutputStream, JMSTextMessage, or File.
The desired method will be generated (as shown below).