@Override
public void serialize( @NotNull T object, @NotNull OutputStream out, @Nullable Lookup context ) throws IOException {
Document document = new Document();
//Add the format version
document.addContent( new ProcessingInstruction( PI_TARGET_FORMAT, getFormatVersion().toString() ) );
//Create the root
Element root = new Element( getDefaultElementName() );
document.setRootElement( root );