Designer's Toolbelt: TextWrangler
While I prefer to leave implementation to the developers, I do have to muck with code on a regular basis. For HTML, I rely on Dreamweaver. I’ve already written about CSSEdit. When it comes to anything else, such as XML, a DTD, or the occasional JavaScript, I pull up TextWrangler.
Bare Bones Software’s TextWrangler is a very simple, yet powerful text editor. It will open any file you throw at it, and can automatically format common types, like XML and HTML. It has robust find & replace capabilities, and can diff files. It can perform basic text transformations, like detabbing and zapping gremlins. It also provides many display options, such as line numbering and soft-wrapping.
It’s a free tool. If you want more functionality, its older brother BBEdit will color syntax, work on files directly over FTP, and much more. Both are available only on the Mac.