I found one way: it is override serialize method in the class that derived from AIFDocument class, that was created from AIF Document Wizard, but I'm thinking that is not right way and i'm looking for the best practice in this task.
The customisation is the adding some sections(Elements) that does not contain in the query DataSource, rename tags, add output calculated values which depend, for instance, on the type of record like display methods and so on.
You could implement an AIF pipeline component, which is a class implementing the interface
AifPipelineComponent
. See classAifXmlTransform
for an example which provides XSLT transformation. After implementing the class you just add it to a AIF port see MSDN