HomeSite, a robust text-based HTML editor for the Wintel world, can be prodded to produce XHTML with a little help. Here's a guide to doing it in the current 4.5 version:

First, go to the Options menu, choose Settings, and configure what you can in the program that will start you down the XHTML path:

Before we get to the fun part (editing the program's internal files), let's note that HomeSite 4.5 does include the HTML Tidy utility integrated into it, which can produce XHTML from HTML pretty readily. So if you don't want to mess further with the HomeSite program, HTML Tidy is a good way to go.

Now, to the good stuff: editing HomeSite's tag wizards to produce XHTML. Don't forget to back up these files before you edit them, because if you break them you'll probably have to reinstall the program to fix them.

The VTM files that make up the tag wizards are located in the /extensions/tagdefs/html directory. For each tag that needs to end with " />" (for example, <br />), open it's corresponding VTM file in HomeSite. Look for a line (usually towards the end of the file) that reads <WIZIF 1>></WIZIF> and change it to read <WIZIF 1> /></WIZIF>.

This works for all tags needing the closing slash except for img, which doesn't have a VTM file. You'll have to either take care of img tags manually, or use an alternate VTM file/wizard for your img tags. I use one by Marjolein Katsma, who originally wrote much of the VTML wizards for HomeSite. You can get a copy of it (called from her web site if you're interested.

Next, we need to edit VTM files for tags such as td, where attributes like nowrap have to be rendered as nowrap="nowrap". Open the VTM file for the tag, and look for a line such as this one in the td file:

<WIZIF checkNOWRAP EQ 'true'>$$SpacingGap$${DefaultCase('NOWRAP')}<WIZSET SpacingGap = VertSpacingGap></WIZIF>

This line is basically outputting nowrap into the tag if the NOWRAP checkbox was checked off. So we just change the output:

<WIZIF checkNOWRAP EQ 'true'>$$SpacingGap$${DefaultCase('NOWRAP=nowrap')}<WIZSET SpacingGap = VertSpacingGap></WIZIF>

At this point, you have all the tag wizards (img aside) producing XHTML. Now, we edit the built-in validator so that it knows all this XHTML is valid:

With that, you should have HomeSite producing XHTML, and its built-in validator will recognize it as valid!