package com.zetcode; import java.util.ArrayList; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; //This statement means that class "Bookstore.java" is the root-element of our example @XmlRootElement(namespace = "com.zetcode") public class BookStore { // XmLElementWrapper generates a wrapper element around XML representation @XmlElementWrapper(name = "bookList") // XmlElement sets the name of the entities @XmlElement(name = "book") private ArrayList bookList; private String name; private String location; public void setBookList(ArrayList bookList) { this.bookList = bookList; } public ArrayList getBooksList() { return bookList; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } }