Procedural Construction

Mets mets = new Mets();

mets.setOBJID("200206.6");

mets.setTYPE("Issue");

  MetsHdr metsHdr = new MetsHdr();

  metsHdr.setCREATEDATE(new Date());

  metsHdrs.setRECORDSTATUS("SIP");

  …

mets.getContent().add(metsHdr);

DmdSec dmdSec = new DmdSec();

  …

mets.getContent().add(dmdSec);

…

mets.validate();

mets.marshal(new FileOutputStream("issue-md.xml"));