Improve export of pi.xml