Unless you have a deep programming background you can't add units in the manner you are trying to do, BUT, don't give up hope, what you can do is mod a pre-existing unit that is not important. For example look for CTW units, just do a search in unitrules.xml and type CTW, you will see there are alot of them, now I'll use your attempt as an example.
Highlight all info of the cataput EXCEPT the very last line that says TYPENAME, you must not change this, select copy, now go to whatever CTW unit you've chosen, highlight all of it again except for the type name, and paste, I would suggest giving the catapult a unique name (this is the first line that says NAME, not the TYPNAME) as I have found that having two units with the same Name can sometimes cause a crash. Now you can do as you please, upgrade the catapults stats, change which nations have it, what age it's available, where it's built etc, etc. The same will work with other units, just be sure you leave the typename alone. Hope this helps.