I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. How could I do this via code? If libraries are needed, please provide relevant info.

A similar solution for XML would also be nice.

Edit
Report