Step 1: Installation
Like TVersity, Windows Media Encoder (WME) is a bit fussy when it comes to loading DivX/XviD files. The steps below involving removing all your existing codecs and installing K-Lite Mega Codec Pack is one that I have tested and found to allow WME to load in DivX/XviD files, however your system may already allow this to happen without installing/uninstalling any codecs. So the general advice is to install WME, load a DivX/XviD file, try to encode it to WMV and if you get the "invalid or corrupt data was encountered" error, try the following steps involving K-Lite Mega Codec Pack.
If you haven't done so already, install Windows Media Player.
As mentioned above, to allow WME to load DivX/XviD files, you may need to uninstall all your existing codec packs and codecs and use K-Lite Mega Codecs Pack. This includes, but is not limited to, DivX, XviD, any codec pack, ffdshow ... everything. Don't worry about messing up playback, because the next step is to download and install the K-Lite Mega Codec Pack.
Start the installation process, and K-Lite will detect more codecs and filters on your system that it recommends you remove - do so and uninstall all the software it asks you (it will replace them with a set of codecs and filters that will be more compatible with WME).
When you get to the "Select Components" screen of the installation, select the "Default" profile.
Scroll down a bit to the "DirectShow video filter" section, and for both the "XviD" and "DivX options , select "ffdshow" to use it as the default decoder. Sometimes the DivX/XviD codec can get in the way of WME. You should probably check the "H.264" checkbox and also select "ffdshow" as the coder (see screenshot below), as this will allow you to convert H.264 files to WMV (although the Xbox 360 does have native support for H.264).
Scroll down to the "VFW video codecs" section and uncheck "XviD and "DivX" codec options.
You can leave the other options alone if you wish, since the default profile will cover most types of playback (mainly using ffdshow and Media Player Classic). Press "Next" on in the installer until you get to the "Select Additional Tasks" section, I would recommend not selecting the AVI or WMV formats under the "Make Media Player Classic the default player for" section - letting Windows Media Player handle these formats is better for testing purposes (to test if the source and output is at the very least playable in WMP).
As for the other options on this screen, if you don't know or don't care, then leave the other options as it is and continue with the installation process. Once it is done, you can test the playback of your DivX/XviD files, and they should play (in WMP or MPC).
For some extra checks, or if your DivX/XviD files no longer plays, do the following: From the start menu folder that the K-Lite installer created, select the "Configuration" -> "ffdshow" -> "video decoder configuration" program. Make sure your screen looks something like the screenshot below, specifically the "XviD" and "DivX 4/5/6" settings (set to "libavcodec"). Press the "Apply" button, close the configuration window and try playback again of your DivX/XviD file - it should play now.
Finally, download and install Windows Media Encoder version 9. The "Windows Media Video 9 Advanced Profile Update Beta" is also available, which adds VC-1 encoding support (VC-1 is used in HD DVD), but that's optional for this guide.