How to generate xml through serializing classes in case of nested xml
<p>my xml is below. i want to generate this same xml structure by using serialization.
so please guide me how to write the class which will generate this same type of xml structure at runtime. please help me with code. thanks.</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;article id="97536" status="new"&gt;
    &lt;analysis type="ALERT"&gt;
        &lt;content&gt;
            &lt;header&gt;
                &lt;date&gt;20071010&lt;/date&gt;
                &lt;hour&gt;14:56&lt;/hour&gt;
                &lt;author&gt;God&lt;/author&gt;
                &lt;media type="IMAGE"&gt;&lt;/media&gt;
                &lt;product&gt;WIPS&lt;/product&gt;
                &lt;option&gt;
                    &lt;period_unit&gt;day&lt;/period_unit&gt;
                    &lt;period_unit_count&gt;1&lt;/period_unit_count&gt;
                    &lt;trend type="0020"&gt;0&lt;/trend&gt;
                    &lt;trend type="0050"&gt;0&lt;/trend&gt;
                    &lt;trend type="0020_50"&gt;0&lt;/trend&gt;
                    &lt;trend type="0101_SL"&gt;0&lt;/trend&gt;
                    &lt;trend type="0909_0"&gt;0&lt;/trend&gt;
                    &lt;volatility type="LITERS"&gt;1&lt;/volatility&gt;
                    &lt;momentum type="11170"&gt;0&lt;/momentum&gt;
                    &lt;momentum type="11130"&gt;0&lt;/momentum&gt;
                    &lt;strength type="VOLUME"&gt;0&lt;/strength&gt;
                &lt;/option&gt;
            &lt;/header&gt;
        &lt;/content&gt;
    &lt;/analysis&gt;
&lt;/article&gt;
</code></pre>
