title: How to generate xml file from DatabaseChangeLog programmatically
body: <p>I made changes on a DatabaseChangeLog object programmatically.
  How could I generate the diffChangeLogFile file based on that DatabaseChangeLog from java.</p>
  
  <p>EDIT:
  here is an example</p>
  
  <pre><code>public DatabaseChangeLog removeDropColumnChangeFromDatabaseChangeLog(
              DatabaseChangeLog databaseChangeLog, String oldName,
              String newName, String tableName) {
  
          DatabaseChangeLog changeLog = databaseChangeLog;
          Collection&lt;ChangeSet&gt; changeSetsToRemove = new ArrayList&lt;ChangeSet&gt;();
  
          List&lt;ChangeSet&gt; changeSets = changeLog.getChangeSets();
  
          // Remove DropColumnChange from ChangeSets using tableName, oldName and
          // newName
          for (ChangeSet cs : changeSets) {
              for (Change change : cs.getChanges()) {
                  if (change instanceof DropColumnChange) {
                      DropColumnChange aux2 = (DropColumnChange) change;
                      if (aux2.getTableName().equals(tableName)) {
                          if (aux2.getColumnName().equals(oldName)) {
                              changeSetsToRemove.add(cs);
                          }
                      }
                  }
              }
          }
          changeSets.removeAll(changeSetsToRemove);
          DatabaseChangeLog databaseChangeLogWithoutAddColumn = new DatabaseChangeLog();
          for (ChangeSet cs : changeSets) {
              databaseChangeLogWithoutAddColumn.addChangeSet(cs);
          }
          return databaseChangeLogWithoutAddColumn;
      }
  </code></pre>
  
  <p>this method will have a DatabaseChangeLog object as input and it will delete the dropColumn change from it when the table name is equal to the tableName parameter.</p>
  
  <p>After this modification on DatabaseChangeLog object I want to generate an xml file which contain the changesets relative to the DatabaseChangeLog object (the xml that liquibase generate after a diff in order to make an update).</p>
  
  <p>Something like this:</p>
  
  <p>databaseChange.generateXmlFile(pathToFile);</p>