I just announced the new Spring 5 modules in REST With Spring:


1. Overview

This is a guide to working with XML in Java.

We’ll go over the most common Java XML processing libraries – for both parsing and binding.

2. DOM Parsers

Simply put, a DOM parser works on the entire XML document, loads it into memory and constructs a tree representation of the document.

Useful Resources

3. SAX Parser

A SAX parser is an event-based parser – it parses the XML document using callbacks without loading the whole document into memory.

Useful Resources

4. StAX Parser

A StAX Parser is median between DOM and SAX parser.

Useful Resources


JAXB – Java Architecture for XML Binding – is used to convert objects from/to XML.

JAXB is a part of the Java SE platform and one of the APIs in Java EE.

Useful Resources

6. XStream

XStream is a simple library to serialize objects to/from XML.

Here’s the maven dependency to use to get it into a Maven enabled project:


Useful Resources

7. Jackson XML

Jackson XML is an extension of Jackson JSON processor for reading and writing XML encoded data.

In order to use it – here’s the simple Maven dependency you’ll need:


Note: Latest version of jackson-dataformat-xml right now is 2.6.3.

Useful Resources

8. Simple XML

Simple XML is a high performance XML serialization framework for Java.

In order to use it you need the following dependency:


Note: Latest version of Simple XML right now is 2.7.1.

Useful Resources

9. Conclusion

This was a quick intro to the XML ecosystem in Java. Use this as a guide to learn more about doing XML work and getting a high level view of the Java XML landscape.

I just announced the new Spring 5 modules in REST With Spring: