So you want to give Vikings Berzerker Axes instead of Berzerker Macemen?
As it happens, you can do this in Civ4. This is a simple tutorial on how to understand and read XML, and how to make a really simple XML mod.
I'm going to assume you have Warlords installed. If you don't, just remove the \Warlords\ part from the file paths, and most of the rest of the advice will work.
...
First, let's poke around.
Look in the following directory.
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets
There are a bunch of subdirectories in this folder.
Art, Python, res, Sounds and XML. In addition, there is a file called CvGameCoreDLL.dll.
Each of these can be modded -- but the easiest kind of mod is done purely in the XML.
Now, we don't want to break our copy of Civ4, so we shouldn't actually edit or open any file in this directory.
To play around, we are going to create a simple sandbox mod.
Go to the following directory:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods
create a subdirectory called "PlayPen".
Congradulations, you just created an empty mod!
Now enter the PlayPen directory, and create a subdirectory called Assets.
Ok, now we are going to copy over the XML data from the core files into our playpen.
Go back to:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets
highlight the XML directory, press ctrl-C to copy it.
Now go back to your Playpen/Assets directory (either go back to the window, or just press "back" on your current window).
Paste the XML directory here.
Chug chug chug goes your computer.
Currently, our mod does absolutely nothing!
Let's test it.
Launch Warlords. Select "advanced", then "load a mod", then select PlayPen.
Hold down the SHIFT key to prevent Warlords from using "cached" data -- this is important when you are changing a mod regularly, because otherwise warlords won't always load the changes! (you don't need to do it now, because this is a brand-new mod, but it is a good habit to get into when hacking away at a mod).
If it doesn't work, well, go back and try again from the start.
Shut down warlords. Your mod is pretty damn empty.
...
Ok, now we have a playpen. We can edit the XML files in our playpen without worrying about breaking your copy of warlords. This seems like a good plan!
Let's look inside our playpen:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods\PlayPen\Assets\XML
There are lots of subdirectories, and two .xml files (GlobalDefines.xml and GlobalTypes.xml).
Let's take a look at one of the simpler XML files: Assets\XML\Units\CIV4UnitInfos.xml
Open it with notepad or your favourate text editor. Do not use wordpad, write, word, or other word processors to read and edit XML files.
Wait a second -- did you just double click the file? That isn't how you open these files for editing. If you double-click the file, you end up with internet explorer or mozilla... which isn't designed to edit XML files.
Right-click on the file, and select "edit". Now you have it open in notepad.
Notepad sucks, but it will do.
Let's look at what you see:
etc. This is XML. Civ4 uses XML pretty simply.
A tag looks like this: <Tag>
An endtag looks like this: </Tag>
An empty tag looks like this: <Tag/>
A comment looks like this: <!-- Comment -->
So, right near the start of our file, we have a tag "Class", that contains the characters UNITCLASS_LION, and then ends..
Civ4 reads these XML files to determine huge chunks of the game content. The tech tree, civic stats, unit stats, difficulty levels, and a million other game features are all set in these XML files.
Now, let's test what we know. The first thing we want to do before editing it make a backup of our XML file. Go back to the directory, and make a copy of CIV4UnitInfos.xml.
Rename the backup copy to CIV4UnitInfos.xml.original. Windows will say "are you sure", and agree.
Now let's play. We are going to take Warriors and Scouts, and increase their combat strength to 100!
Why? Because we can, and it is easy to tell if we screwed up -- just start a game.
Go back to your notepad window. Press CTRL-F to open a FIND window. Type in UNIT_WARRIOR.
You should have part of <Type>UNIT_WARRIOR</TYPE> highlighted.
Now, the people who made this XML file where nice. They indenting things nicely. The Warrior unit data starts at the previous <UnitInfo> tag and ends at the next </UnitInfo> tag, and all of the warrior data is intented in one block.
Now for the hard part: search the data until you find <iCombat>2</iCombat>. You can do this by hand, or you can try using Find again.
If you use Find, make sure you are still inside the warrior unit definition.
Change the number 2 to 100.
Next, search for UNIT_SCOUT.
... wait, notepad just told you that it can't find it. Well, search for it again, but this time search upwards. Keep on searching until you are on the line with <Type>UNIT_SCOUT</Type>.
Now search downwards until you find <iCombat>1</iCombat>.
Change that to 100.
Now save the file. Close notepad.
Relauch warlords, advanced, load a mod, playpen, then start a game.
Is your scout and/or warrior now strength 100? Congradulations!
Shut down warlords. You just made your first working mod to the game. A rather silly mod, but a mod.
...
Ok, next step: clean up what you did. Delete your Civ4UnitInfos.xml, then copy (not rename!) Civ4UnitInfos.xml.original to Civ4UnitInfos.xml. You don't want to have a 100 strength warrior wandering around.
Now let's make a different change: make the viking berzerker into an axeman.
Search Civ4UnitInfos.xml for "BESERKER". When you find the <Type>UNIT_VIKING_BESERKER</Type> line, you are at the right spot.
Look above it. See the <Class> line? It says the BESERKER is a MACEMAN class. Change that to UNITCLASS_AXEMAN.
Our BESERKER is now replacing the AXEMAN.
We aren't quite done -- the problem is, our BESERKER still has strength 8 -- a bit too high for the era. Search down for the iCombat tag, and change the 8 to a 5 (from maceman strength to axeman strength).
Safe the file. Relaunch warlords and reload the mod. Remember to hold down shift.
Launch a game, and check out the civipedia entry on berserkers. They are now axemen, at least in the game-content, if not in the description.
Neat! But we aren't done learning yet. The playpen is useful for exploring and experimenting, but it isn't quite the right way to make a mod. You don't need nearly that many files.
...
Next, pruning your mod. You have a complete copy of every XML file in your mod. This is unnessicary.
Create a new mod directory in
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods\
called VikingAxes.
Create the subdirectories Assets\XML\Units.
Copy the Civ4UnitInfos.xml file from your PlayPen to your VikingAxes mod. Remember to copy it to the right location!
Now lanch warlords and load your viking axes mod. Check the civopedia -- did the change work? Congradulations!
The trick is, the game looks in your mod directory FIRST, then it looks in your CustomAssets folder, then it looks in the game assets folder, for each file. So files you don't modify you shouldn't place in your mod.
This keeps your mod size down, and reduces the amount of effort required to "update" your mod.
I would also advise keeping a copy of the "original" file around inside of your mod. By calling it "Civ4UnitInfos.xml.original", the Civ4 mod loader ignores it (it loads files ending in .xml, not .original), and it means when you download a new patch you can use "difference" utilities to figure out what you have to change to make your mod work.
But that is beyond XML 101. I hope this was a useful tutorial.
To figure out what a given tag does, I find it useful to look for a unit that has it set to a non-zero value. Then look at that unit in game. You can usually work it out.
Quite often when making changes warlords will give you errors. This is why you ALWAYS keep a backup copy of what the file was before you changed it.
Some common errors: duplicate tags. Misspelled tags. Forgetting a /, having an extra /, forgetting to close a tag, and the hard one: not being in sync with other files.
The name UNITCLASS_MACEMAN isn't just a magic name -- all of the UNITCLASSes are defined and described in another XML file -- CIV4UnitClassInfos.xml. If you want a new UNITCLASS, it has to be added there.
There are lots of such references -- all of the names of things in the game are in one XML file (so they have translations), the civeopedia entries are in another, etc. When you want to do more complex mods, you have to keep these linkages in mind.
Also note that adding a new tag will cause errors -- to add a new tag, you have to play around with schemas, and then write python/C++ code that understands the new tag data and makes it happen in the game.
Good luck on your modding!
As it happens, you can do this in Civ4. This is a simple tutorial on how to understand and read XML, and how to make a really simple XML mod.
I'm going to assume you have Warlords installed. If you don't, just remove the \Warlords\ part from the file paths, and most of the rest of the advice will work.
...
First, let's poke around.
Look in the following directory.
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets
There are a bunch of subdirectories in this folder.
Art, Python, res, Sounds and XML. In addition, there is a file called CvGameCoreDLL.dll.
Each of these can be modded -- but the easiest kind of mod is done purely in the XML.
Now, we don't want to break our copy of Civ4, so we shouldn't actually edit or open any file in this directory.
To play around, we are going to create a simple sandbox mod.
Go to the following directory:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods
create a subdirectory called "PlayPen".
Congradulations, you just created an empty mod!

Now enter the PlayPen directory, and create a subdirectory called Assets.
Ok, now we are going to copy over the XML data from the core files into our playpen.
Go back to:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets
highlight the XML directory, press ctrl-C to copy it.
Now go back to your Playpen/Assets directory (either go back to the window, or just press "back" on your current window).
Paste the XML directory here.
Chug chug chug goes your computer.
Currently, our mod does absolutely nothing!
Let's test it.
Launch Warlords. Select "advanced", then "load a mod", then select PlayPen.
Hold down the SHIFT key to prevent Warlords from using "cached" data -- this is important when you are changing a mod regularly, because otherwise warlords won't always load the changes! (you don't need to do it now, because this is a brand-new mod, but it is a good habit to get into when hacking away at a mod).
If it doesn't work, well, go back and try again from the start.
Shut down warlords. Your mod is pretty damn empty.
...
Ok, now we have a playpen. We can edit the XML files in our playpen without worrying about breaking your copy of warlords. This seems like a good plan!
Let's look inside our playpen:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods\PlayPen\Assets\XML
There are lots of subdirectories, and two .xml files (GlobalDefines.xml and GlobalTypes.xml).
Let's take a look at one of the simpler XML files: Assets\XML\Units\CIV4UnitInfos.xml
Open it with notepad or your favourate text editor. Do not use wordpad, write, word, or other word processors to read and edit XML files.
Wait a second -- did you just double click the file? That isn't how you open these files for editing. If you double-click the file, you end up with internet explorer or mozilla... which isn't designed to edit XML files.
Right-click on the file, and select "edit". Now you have it open in notepad.
Notepad sucks, but it will do.
Let's look at what you see:
Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Unit Infos -->
<Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">
<UnitInfos>
<UnitInfo>
<Class>UNITCLASS_LION</Class>
<Type>UNIT_LION</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>NONE</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ANIMAL</DefaultUnitAI>
<Invisible>NONE</Invisible>
etc. This is XML. Civ4 uses XML pretty simply.
A tag looks like this: <Tag>
An endtag looks like this: </Tag>
An empty tag looks like this: <Tag/>
A comment looks like this: <!-- Comment -->
So, right near the start of our file, we have a tag "Class", that contains the characters UNITCLASS_LION, and then ends..
Civ4 reads these XML files to determine huge chunks of the game content. The tech tree, civic stats, unit stats, difficulty levels, and a million other game features are all set in these XML files.
Now, let's test what we know. The first thing we want to do before editing it make a backup of our XML file. Go back to the directory, and make a copy of CIV4UnitInfos.xml.
Rename the backup copy to CIV4UnitInfos.xml.original. Windows will say "are you sure", and agree.
Now let's play. We are going to take Warriors and Scouts, and increase their combat strength to 100!
Why? Because we can, and it is easy to tell if we screwed up -- just start a game.
Go back to your notepad window. Press CTRL-F to open a FIND window. Type in UNIT_WARRIOR.
You should have part of <Type>UNIT_WARRIOR</TYPE> highlighted.
Now, the people who made this XML file where nice. They indenting things nicely. The Warrior unit data starts at the previous <UnitInfo> tag and ends at the next </UnitInfo> tag, and all of the warrior data is intented in one block.
Now for the hard part: search the data until you find <iCombat>2</iCombat>. You can do this by hand, or you can try using Find again.
If you use Find, make sure you are still inside the warrior unit definition.
Change the number 2 to 100.
Next, search for UNIT_SCOUT.
... wait, notepad just told you that it can't find it. Well, search for it again, but this time search upwards. Keep on searching until you are on the line with <Type>UNIT_SCOUT</Type>.
Now search downwards until you find <iCombat>1</iCombat>.
Change that to 100.
Now save the file. Close notepad.
Relauch warlords, advanced, load a mod, playpen, then start a game.
Is your scout and/or warrior now strength 100? Congradulations!
Shut down warlords. You just made your first working mod to the game. A rather silly mod, but a mod.
...
Ok, next step: clean up what you did. Delete your Civ4UnitInfos.xml, then copy (not rename!) Civ4UnitInfos.xml.original to Civ4UnitInfos.xml. You don't want to have a 100 strength warrior wandering around.

Now let's make a different change: make the viking berzerker into an axeman.
Search Civ4UnitInfos.xml for "BESERKER". When you find the <Type>UNIT_VIKING_BESERKER</Type> line, you are at the right spot.
Look above it. See the <Class> line? It says the BESERKER is a MACEMAN class. Change that to UNITCLASS_AXEMAN.
Our BESERKER is now replacing the AXEMAN.
We aren't quite done -- the problem is, our BESERKER still has strength 8 -- a bit too high for the era. Search down for the iCombat tag, and change the 8 to a 5 (from maceman strength to axeman strength).
Safe the file. Relaunch warlords and reload the mod. Remember to hold down shift.
Launch a game, and check out the civipedia entry on berserkers. They are now axemen, at least in the game-content, if not in the description.
Neat! But we aren't done learning yet. The playpen is useful for exploring and experimenting, but it isn't quite the right way to make a mod. You don't need nearly that many files.
...
Next, pruning your mod. You have a complete copy of every XML file in your mod. This is unnessicary.
Create a new mod directory in
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Mods\
called VikingAxes.
Create the subdirectories Assets\XML\Units.
Copy the Civ4UnitInfos.xml file from your PlayPen to your VikingAxes mod. Remember to copy it to the right location!
Now lanch warlords and load your viking axes mod. Check the civopedia -- did the change work? Congradulations!
The trick is, the game looks in your mod directory FIRST, then it looks in your CustomAssets folder, then it looks in the game assets folder, for each file. So files you don't modify you shouldn't place in your mod.
This keeps your mod size down, and reduces the amount of effort required to "update" your mod.
I would also advise keeping a copy of the "original" file around inside of your mod. By calling it "Civ4UnitInfos.xml.original", the Civ4 mod loader ignores it (it loads files ending in .xml, not .original), and it means when you download a new patch you can use "difference" utilities to figure out what you have to change to make your mod work.
But that is beyond XML 101. I hope this was a useful tutorial.
To figure out what a given tag does, I find it useful to look for a unit that has it set to a non-zero value. Then look at that unit in game. You can usually work it out.

Quite often when making changes warlords will give you errors. This is why you ALWAYS keep a backup copy of what the file was before you changed it.
Some common errors: duplicate tags. Misspelled tags. Forgetting a /, having an extra /, forgetting to close a tag, and the hard one: not being in sync with other files.
The name UNITCLASS_MACEMAN isn't just a magic name -- all of the UNITCLASSes are defined and described in another XML file -- CIV4UnitClassInfos.xml. If you want a new UNITCLASS, it has to be added there.
There are lots of such references -- all of the names of things in the game are in one XML file (so they have translations), the civeopedia entries are in another, etc. When you want to do more complex mods, you have to keep these linkages in mind.
Also note that adding a new tag will cause errors -- to add a new tag, you have to play around with schemas, and then write python/C++ code that understands the new tag data and makes it happen in the game.
Good luck on your modding!