Chapter 3. Writing XML with Java

No one ever believes me when I tell them how easy it is to develop programs that write XML documents. In fact, writing a program to output an XML document is unbelievably trivial. It's something an eight-year-old typing BASIC in his or her first class at computer camp can do. In Java, it's even easier than that due to Java's strong Unicode support. You don't need to know any special APIs like DOM, or SAX, or JDOM. All you need to know is how to System.out.println(). If you want to store your XML document in a file, you can use the FileOutputStream class instead. If you want to serve the document dynamically over a network, it helps to know something about servlets; but in the end, it all reduces to writing bytes ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.