<html>
<body>
<%@ page import="java.io.*,java.util.*,org.jdom.*,org.jdom.input.*,org.jdom.output.*;" %>
<%
String pId1 = "";
String pTitle1 = "";
String pAuthor1 = "";
String pId2 = "";
String pTitle2 = "";
String pAuthor2 = "";
Document doc = new Document();
Element elRoot = new Element("books");
doc.setRootElement(elRoot);
Element elBook = new Element("book");
elBook.setAttribute("id", "1");
Element elTitle = new Element("title");
elTitle.addContent(new Text("Java 2 Enterprise Edition"));
elBook.addContent(elTitle);
elBook.addContent((Element)new Element("author").addContent(new Text("Mark Wuttka")));
elRoot.addContent(elBook);
elBook = new Element("book");
elBook.setAttribute("id", "2");
elBook.addContent((Element)new Element("title").addContent(new Text("JavaServer Pages and Servlets")));
elBook.addContent((Element)new Element("author").addContent(new Text("Irgendwer")));
elRoot.addContent(elBook);
Format format = Format.getPrettyFormat();
format.setEncoding("iso-8859-1");
XMLOutputter xmlOut = new XMLOutputter(format);
xmlOut.output(doc, new FileOutputStream("D://rewrite.xml"));
out.println("<div align='left'>Success in <b>creating</B> rewrite.xml!</div>");
%>