Dude!! Really good question out there. I remember asking the very same thing myself well... now that I think of it quite some time ago.
Writing programming code (Whether it be XML or C or VB routines or even Java, Perl) can be done in a simple notepad.exe program, which has been provided as part of Windows OS forever.
There are some programs (Textpad, JEdit, etc) that actually have a sorts of spell-checker, that knows the syntax for that programming language, and helps you keep track of whether you have arleady closed a routine by using the } key, and etc.
Microsoft for example, has the .NET programming interface, one for each language, where you can type and create your code.
Now, is it necessary? Perhaps desired, but definitely not Vital.
What is required, is a program that we call Compiler. A Compiler, will basically grab any written code (say a C++ file, which we created on notepad.exe and saved as test.cpp) and it will then translate it into binary code, which is what the computer can actually understand. The end result of these conversions are .exe files, and a wide variety of other data.
Without a Compiler, the computer would never be able to truly interpret and follow the directions of the code.
I hope this makes some sense. Once we get the code down, we can write little applets and routines anywhere, I often end up using my blackberry and emailing myself those thoughts, and then pasting them onto a notepad file.
Now when I sit down to work on XML or Perl, I do try to find some program (Dreamweaver, or a Freeware Perl compiler) where I can create, type and think without focusing too much, and have the program help me out to say "Hey, you forgot to put end quote here, or finish the sentence there".
So in conclusion, we write Code (Instructions) > They get "Compiled" into Binary Code (Ones and Zeros, that the Computer's hardware can understand) and > We execute that Code whenever it is necessary. The machine/OS reads the 1s and 0s, and returns with the results of those instructions.
Keep coming with the great questions.