PDF and XML generation