What are good free and widely used tools for editing 2D sprite-based game levels? I'm looking for one that allows exporting data to a custom format. One that I know of is Blender — a 3D tool, primarily, but can be used for 2D art as well — which also supports Python scripts for exporting data.
Gleed 2D is the most popular tool. It has recently been rewritten and can be found on GitHub.
The output of the tool is a simple XML file. If you're using XNA, there's a small component that'll turn the XML into an object graph. There's versions for Windows, XBox, and Windows Phone.
The new version contains lighting and behaviours:
It's been a while since the last update, but there's Gleed2D. I've used it before and it's pretty straightforward. Basically set up your layers, drag and drop sprites into the stage, and transform them into the correct place. Then export to XML and read on your game.
Take a look at Tiled.