hi,
i'm selecting data from a table say something like invoice.i'm using dbms_xmlquery.well i want something like the xml struc shown below
<header>
<INVOICE_NUM>1499</INVOICE_NUM>
<INVOICE_TYPE>STANDARD</INVOICE_TYPE>
<VENDOR_NAME>xyz</VENDOR_NAME>
<detail>
<DISTRIB_LINE_ID>1</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>200</DISTRIB_LINE_AMT>
<DISTRIB_LINE_ID>2</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>250</DISTRIB_LINE_AMT>
<DISTRIB_LINE_ID>3</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>300</DISTRIB_LINE_AMT>
</detail>
</header>
<header>
<INVOICE_NUM>1492</INVOICE_NUM>
<INVOICE_TYPE>STANDARD</INVOICE_TYPE>
<VENDOR_NAME>xyu</VENDOR_NAME>
<detail>
<DISTRIB_LINE_ID>1</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>200</DISTRIB_LINE_AMT>
<DISTRIB_LINE_ID>2</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>250</DISTRIB_LINE_AMT>
<DISTRIB_LINE_ID>3</DISTRIB_LINE_ID>
<DISTRIB_LINE_AMT>300</DISTRIB_LINE_AMT>
</detail>
</header>

i'm querying from the same table.is this possible?

i also want to know what advantage i get using xmlgen over dbms_xmlquery.

Regds
Manojkv