OMDocument omDocument = getSampleOMDocument(sampleXML);
// serialise it to a string
String outXML = "";
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
OMOutputImpl output = new OMOutputImpl(outStream, false);
omDocument.serialize(output);
output.flush();
outXML = new String(outStream.toByteArray());
// again load that to another builder
OMDocument secondDocument = getSampleOMDocument(outXML);