fill form

I have a dynamic XFA Form that I can fill out manually using Adobe Acrobat on my computer. Using iTextSharp I can read what the XFA XML data is and see the structure of the data. But how can I fill out the form programmatically?
What techniques available to fill a PDF form automatically using external data and save them. I have to use data from a database to fill a template PDF and save a copy of it on disk with that data. Language and platform is not issue but it would be good if it can run on windows and Linux.
My code to fill out an XFA form throws no exception and everything seems to be OK, but if I open filled pdf, Adobe Reader says something like this: This document enabled extended features. This document was changed since it was created and using extended features isn't possible anymore.
I have a PDF with text form fields at are layered one on top of the other. When I fill the fields via iText and flatten the form, the form field that I had created on top of the other form field is now on the bottom.
I assume I need to flatten a XFA form in order to display properly on the UI of an application that uses Nuance's CSDK. When I process it now I get a generic message "Please Wait.... If this message is not eventually replaced."
Tags: fdfxfdfformsfill formiText 7
This example was written in answer to the question How to save an .xfdf file as a .pdf file?
Tags: formscheck boxfill form
This example was written in answer to the question How to check a check box?
Tags: formscheck boxfill formiText 7
I've tried so many different ways, but I can't get the check box to be checked!