rendered paste bodyimport java.io.*;import org.jdom.*;import org.jdom.output.*;public class JDOMCreation {public static void main(String[] args) {Element root = new Element("todolist"), item;Document doc = new Document(root);item = buildItem("1", "6", "Leggere la posta", "2");root.addContent(item);item = buildItem("2", "9", "Rivoluzione", "2");root.addContent(item);item = buildItem("3", "8", "Andate a correre nel parco", "1");root.addContent(item);try {XMLOutputter outputter = new XMLOutputter();outputter.setNewlines(true);outputter.setIndent(" ");outputter.output(doc, System.out);} catch(IOException e) {System.err.println("Errorre durante la serializzazione del documento");e.printStackTrace();}}private final static Element buildItem(String numer, String priority, String description, String state) {Element item = new Element("item"), numberEl = new Element("number"), prirityEl = new Element("priority"), descriptionEl = new Element("description"), stateEl = new Element("state");numberEl.setText(number);priority.El.setText(priority);descriptionEl.setText(description);stateEl.setText(state);item.addContent(numberEl);item.addContent(priorityEl);item.addContent(descriptionEl);item.addContent(stateEl);return item;}}