I have written sort of a line editor for my game. It allows you to draw lines and save them to a file (no .xml or .txt though). It has line snapping, but no grid snapping (there is no grid). However you can load an image in the background to draw upon. It's actually nothing fancy, but does what I need it to do. There aren't that many comments (never intended to release it), but I believe the source is pretty straightforward.
You can download the source/bin from here and use it freely for your own projects. In case you happen to add new features, I'd appreciate it if you release them again