XML import and better pdf generation