I appreciate that both methods have their pros and cons, and think it is a fantastic idea, but I'm trying to work out if there may be another way to go about it (I'm not saying this is how it SHOULD be done, just offering another suggestion). I'm not 100% familiar with the source yet (I've put it down for a school holiday break - maybe I can incorporate work on GAE/MegaGlest into the advanced IT class where I teach programming), so my suggestion may not even be possible.
Consider the following situation:
Faction Units: Elephant (mounted archer), Horseman (mounted sword), HorseArcher (mounted archer), Pikeman, Swordsman, Archer.
Here is how the attacks might pan out:
Elephant <Crushes> Everyone Else (when Speed > 0 and <Collision> => speed -=1)
Elephant <Pierces> Everyone Else (at Distance X)
Horseman & HorseArcher <Chrushes> Pikeman, Swordsman, Archer (when Speed > 2 and <Collision> => speed -=1)
Horseman <Slashes> Pikeman, Swordsman, Archer (when Speed <= 2 and <Collision>)
HorseArcher <Pierces> Pikeman, Swordsman, Archer (when Speed <= 2 or at Distance X)
Pikeman <Pierces> Everyone Else (highly effective against <mounted> units)
Swordsman <Slashes> Everyone Else
Archer <Pierces> Everyone Else (at Distance X)
Archer <Pierces> Everyone Else (Very ineffective at Distance = 0)
Ok, so that gives us an idea about how the various battles between the types of units play out. Consider the complexities of various types of death animations that could exist here for just a minute...
Now we can't use a simple unit-type check - the Horseman, HorseArcher and Elephant all have different types of attacks depending on how they kill you. We also can't use an attack type - both the Pikeman and the Archer pierce, but one uses a pike and one uses an arrow. You also can't use the hybrid that's been tossed around - at least not without performing additional checks, and that starts to become complicated and very unit specific.
So, there must be a better way. Assuming, that is, that units can have more than one type of attack (which seems logical).
I know you want mods to be pretty flexible, but with flexibility comes overhead - whether it be code processing overhead or logic complexities, it can't be avoided.
The only way it can be done (IMHO) would be to alter the XML tree so that the various conditions can be defined in there somehow. That should also simplify the code, since all that you'd need to do then would be to parse the XML and, depending on the number and order of keys read, execute the appropriate code snippet. That might be beyond the scope of a minor revision, though...