Hi Rovsh,
You could use just XForms for something like this, but in general people find it easier to use another language to generate the XForms based on the non-XForms definition of the form (in your case, information stored in your database). XSLT is is often used for this. So one could do:
1. Retrieve the data describing the form from the database and encode that in XML.
2. Using XSLT, produce XForms based on the document generated in 1.
3. Orbeon Forms XForms engine "runs" the output of 2.
And you could use a pipeline (XPL) to put together those steps 1 -> 2 -> 3.
Alternatively, you could write Java code that generates the XForms, this in a separate web app, and use separate deployment (see link below) to feed the XForms you generate in your app to the Orbeon Forms web app.
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-with-java-applicationsAlex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet