newbie question about XML with java



I am relatively new to java and would like to create a XML file which looks like this:

<archive name="archive1">
  <file name="xx">
    <size>100</size>
    <ext>jpg</ext>
  </file>
</archive>

can anybody show me a code snippet how I can make that?
thanks for help in advance!
.