Fix integer overflow when creating xml data
TiXmlElement::SetAttribute casted "size_t" to "int" which caused it to overflow