Skip to content
A standalone Java XML DOM parser and serializer
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status Maintainability contributions welcome HitCount Coverage Status PDD status Codacy Badge Sputnik MIT Licence CII Best Practices Maven Central


After a number of bad experiences with XML parsing in Java I decided to write my own parser.

This project has the following characteristics; correct XML parsing, small, few dependencies, thread-safe, user friendly API, secure.

How to use

The unit tests in src/test/java/unittests can give you a good idea of the capabilities of SimpleXml. There are also a number of small example programs in src/test/java/tools that showcase various features.


The simplest case possible:

public class MyObject {
    String name;

MyObject object = new MyObject(); = "test";

final SimpleXml simple = new SimpleXml();

This code will output:


There are more serialization options

  • Renaming fields
  • Fields as attributes
  • Field as text node
  • Skipping fields

For more documentation on serializing look in src/docs/


The simplest case possible:

public class MyObject {
    String name;

final SimpleXml simple = new SimpleXml();
final MyObject object = simple.fromXml("<myobject><name>test</name></myobject>");

This code will output:


The deserializer will respect the same annotations as the serializer

  • Renamed fields
  • Attributes
  • Text nodes
  • Skipped fields

How to get

Its in maven central.


Or alternatively you can clone the repo and install locally:

git clone
cd simplexml
mvn install


The MIT license. And I left out the copyright notice everywhere because I just don't care.

Future Ideas

There are a bunch of features that I could add. In no particular order:

  • Support comments
  • Support CDATA blocks
  • XML streaming
    • Push and Pull
    • object, xpath
  • Validation
You can’t perform that action at this time.