How to create xml file from a list of objects in java?
<p>I want to create one xml file from one list of objects. Objects are having some attributes, so the tags will be the attribute names and the respective data will be inside the tag.
This is example:
I have one List: myEquipmentList there are some 100 objects of the class Equipment. Now the attributes in the class of Equipment are id,name, size, measures,unit_of_measure etc.
Now I want to create xml which will be something like this.</p>

<pre><code>&lt;Equipment id=1&gt;``
&lt;name&gt;Ruler&lt;/name&gt;
&lt;size&gt;1000&lt;/size&gt;
&lt;measures&gt;length&lt;/measures&gt;
&lt;unit_of_measure&gt;meter&lt;/unit_of_measure&gt;
&lt;/Equipment&gt;
</code></pre>

<p>Please help.
Thanks in advance!!</p>
