Added dependency compilation for both tex and xml, and fixed some other things in the code generator