code: public void saveTo(File file) throws IOException{
          FileOutputStream fout = null;
          try{
              fout = new FileOutputStream(file);
              SyntaxDocument xml = new SyntaxDocument(new StreamResult(fout));
              xml.startDocument();
              xml.add(this);
              xml.endDocument();
          }catch(IOException ex){
              throw ex;
          }catch(Exception ex){
              throw new IOException(ex);
          }finally{
              try{
                  if(fout!=null)
                      fout.close();
              }catch(IOException ex){
                  ex.printStackTrace();
              }
          }
      }
docs: /*-------------------------------------------------[ Serialization ]---------------------------------------------------