element Entity {
    attribute Parent { text }?,
    element Traits {
        attribute Extant { "true" }? & # ignore
        attribute extant { "" }? & # ignore
        element Corpse { text }? & # ignore
        element Id {
            element Internal_Only { empty }? & # ignore
            element Generic { text }? & # ok
            element Specific { text }? & # ok
            element Icon { text }? & # ok
            element Icon_Cell { xsd:integer }? & # ok
            element Classes { text }? & # ok
            element Rollover { text }? & # ok
            element Tooltip { text }? & # ok
            element History { text }? & # ok
            element Civ { text }? & # ok
            element Civ_Code { text }? # ignore
        }? &
        element IsTerritoryCentre { "true" }? & # ok
        element Audio {
            element Path { text } # ignore
        }? &
        element Population {
            element Rem { xsd:integer }?, # ok
            element Add { xsd:integer }? # ok
        }? &
        element Creation {
            element Foundation { text }? & # ok
            element Time { xsd:decimal }? & # ok
            element Resource {
                element Wood { xsd:integer }? & # ok
                element Metal { xsd:integer }? & # ok
                element Food { xsd:integer }? & # ok
                element Stone { xsd:integer }? # ok
            }? &
            element Socket { "Settlement" }? & # ok
            element BuildingLimitCategory { text }? & # ok
            element TerritoryRestriction { "All" | "Allied" }? # ok
        }? &
        element Anchor {
            element Type { "Ground" | "Water" }?, # ok
            element ConformX { xsd:decimal }?, # ok
            element ConformZ { xsd:decimal }? # ok
        }? &
        element Footprint {
            element Radius { xsd:decimal }?, # ok
            element Width { xsd:decimal }?, # ok
            element Depth { xsd:decimal }?, # ok
            element Height { xsd:decimal } # ok
        }? &
        element Garrison {
            element Max { xsd:integer } # ok
        }? &
        element Health {
            element Max { xsd:integer }?, # ok
            element RegenRate { xsd:decimal }?, # ok
            element BarHeight { xsd:decimal }?, # ignore
            element Bar_Size { xsd:integer }?, # ignore
            element Repairable { empty }?, # ok
            element Healable { empty }? # ok
        }? &
        element Armour {
            element Hack { xsd:decimal }?, # ok
            element Pierce { xsd:decimal }?, # ok
            element Crush { xsd:decimal }? # ok
        }? &
        element Stamina {
            element Max { xsd:decimal }?, # ok
            element BarHeight { xsd:decimal }?, # ignore
            element Bar_Size { xsd:integer }? # ignore
        }? &
        element Rank {
            element Height { xsd:decimal } # ignore
        }? &
        element Ai {
            element Behaviour { "Aggressive" | "Violent" | "Skittish" | "Passive" | "Defensive" } # ok
        }? &
        element MiniMap {
            element Type { text }, # ok
            element Red { xsd:integer }?, # ok
            element Green { xsd:integer }?, # ok
            element Blue { xsd:integer }? # ok
        }? &
        element Vision {
            element Los { xsd:decimal }?, # ok
            element Permanent { xsd:boolean }? # ok
        }? &
        element Supply {
            element Max { xsd:integer }, # ok
            element Type { text }, # ok
            element SubType { text }? # ok
        }? &
        element Loot {
            element Xp { xsd:integer }?, # ok
            element Food { xsd:decimal }?, # ok
            element Wood { xsd:decimal }?, # ok
            element Stone { xsd:integer }?, # ok
            element Metal { xsd:integer }? # ok
        }? &
        element Auras { # ok
            element Dropsite {
                element Radius { xsd:decimal }? &
                element Types {
                    element Food { empty }?,
                    element Wood { empty }?,
                    element Stone { empty }?,
                    element Metal { empty }?
                }? &
                element r { xsd:decimal }? &
                element g { xsd:decimal }? &
                element b { xsd:decimal }? &
                element a { xsd:decimal }?
            }? &
            element Trample {
                element Radius { xsd:decimal }? &
                element Speed { xsd:integer }? &
                element Duration { xsd:integer }? &
                element Crush { xsd:decimal }? &
                element Hack { xsd:decimal }? &
                element Pierce { xsd:decimal }? &
                element r { xsd:decimal }? &
                element g { xsd:decimal }? &
                element b { xsd:decimal }? &
                element a { xsd:decimal }?
            }? &
            element (Infidelity | Allure | Heal | Fear | Courage) {
                element Radius { xsd:decimal }? &
                element Bonus { xsd:integer }? &
                element Rate { xsd:integer }? &
                element Time { xsd:integer }? &
                element Speed { xsd:integer }? &
                element r { xsd:decimal }? &
                element g { xsd:decimal }? &
                element b { xsd:decimal }? &
                element a { xsd:decimal }?
            }*
        }? &
        element Display { # ok
            element Bars {
                element Enabled { xsd:boolean },
                element Offset { xsd:decimal },
                element Width { xsd:decimal },
                element Height { xsd:decimal }
            }
        }? &
        element Promotion {
            element Entity { text }?, # ok
            element Req { xsd:integer }? # ok
        }? &
        element Formation { # ignore
            element Category { "Melee" },
            element Curr { "Loose" },
            element List {
                element * { empty }+
            }
        }?
    }?,
    element Actions {
        element Attack {
            element Hack { xsd:decimal }?, # ignore
            element Pierce { xsd:decimal }?, # ignore
            element Crush { xsd:decimal }?, # ignore
            element Ranged {
                (element Hack { xsd:decimal }? & # ok
                element Pierce { xsd:decimal }? & # ok
                element Crush { xsd:decimal }?), # ok
                element MinRange { xsd:decimal }?, # ok
                element Range { xsd:decimal }?, # ok
                element Speed { xsd:integer }?, # ok
                element ProjectileSpeed { xsd:decimal }? # ok
            }?,
            element Melee {
                element Hack { xsd:decimal }?, # ok
                element Pierce { xsd:decimal }?, # ok
                element Crush { xsd:decimal }?, # ok
                element Range { xsd:decimal }?, # ok
                element RangeMin { xsd:decimal }?, # ok
                element Speed { xsd:integer }? # ok
            }?,
            element Charge {
                element Hack { xsd:decimal }?, # ok
                element Pierce { xsd:decimal }?, # ok
                element Crush { xsd:decimal }?, # ok
                element Range { xsd:decimal }?, # ok
                element RangeMin { xsd:decimal }?, # ok
                element Speed { xsd:integer }? # ok
            }?
        }? &
        element Create {
            element List {
                element StructCiv {
                    element * { empty }+ # ok
                }?,
                element StructMil {
                    element * { empty }+ # ok
                }?,
                element Train {
                    element * { empty }+ # ok
                }?,
                element Research {
                    element * { empty }* # ignore
                }?
            }?,
            element Speed { xsd:integer }?, # ignore
            element Rally { empty }? # ignore
        }? &
        element Explore { empty }? & # ignore
        element Patrol { empty }? & # ignore
        element Escort {
            element Distance { xsd:decimal } # ignore
        }? &
        element Barter { # ignore
            element List {
                element Food { empty },
                element Wood { empty },
                element Stone { empty },
                element Metal { empty }
            }
        }? &
        element Move {
            element Speed { xsd:decimal }, # ok
            element Speed_Curr { empty }?, # ignore
            element TurningRadius { xsd:decimal }?, # ignore
            element Run {
                element Speed { xsd:decimal } & # ok
                element Range { xsd:decimal }? & # ok
                element RangeMin { xsd:decimal }? & # ok
                element RegenRate { xsd:decimal }? & # ok
                element DecayRate { xsd:decimal }? # ok
            }?,
            element PassThroughAllies { "true" }? # ignore
        }? &
        element Gather {
            element Resource {
                element Food {
                    element Fruit { xsd:decimal }?, # ok
                    element Grain { xsd:decimal }?, # ok
                    element Meat { xsd:decimal }, # ok
                    element Fish { xsd:decimal }? # ok
                } &
                element Wood { xsd:decimal }? & # ok
                element Metal { xsd:decimal }? & # ok
                element Stone { xsd:decimal }? # ok
            }?,
            element AffectedByAllure { "true" }?, # ignore
            element Range { xsd:decimal }?, # ignore
            element Speed { xsd:integer } # ok
        }? &
        element Repair {
            element Rate { xsd:decimal }, # ignore
            element Speed { xsd:integer } # ignore
        }? &
        element Build {
            element Rate { xsd:decimal }, # ignore
            element Speed { xsd:integer } # ignore
        }? &
        element Loot {
            element Resources { empty }?, # ok
            element Xp { empty }? # ok
        }? &
        element TownBell { empty }? # ignore
    }?,
    element Actor { text }?, # ok
    element SoundGroups {
        element (Walk|Run|Melee|Death|Build|Gather_Fruit|Gather_Grain|Gather_Wood|Gather_Stone|Gather_Metal) { text }+ # ok
    }?,
    element Script { attribute File { text } }?, # ignore
    element Event { attribute On { text }, attribute Function { text } }* # ignore
}
