Found a quick and simple way to add JSON and XML formatting to documents in gedit:
http://www.connorgarvey.com/blog/?p=264
This is the best solution I’ve seen so far since it does not require any additional tools. It’s just two Python snippets (and Python is a gedit dependency anyway).