Platform   platform = getPlatform(); DataWriter writer   = new DataWriter(new FileOutputStream(_outputFile), _encoding); Table[]    tables   = new Table[1];  registerConverters(writer.getConverterConfiguration());    writer.writeDocumentStart(); for (int idx = 0; idx < model.getTableCount(); idx++) { tables[0] = (Table)model.getTable(idx);  writer.write(platform.query(model, "select * from "+tables[0].getName(), tables)); } writer.writeDocumentEnd();
getDataIO().writeDataToXML(getPlatform(), new FileOutputStream(_outputFile), _encoding);
    public void execute(Task task, Database model) throws BuildException    {        try        {            Platform   platform = getPlatform();            DataWriter writer   = new DataWriter(new FileOutputStream(_outputFile), _encoding);            Table[]    tables   = new Table[1];                        registerConverters(writer.getConverterConfiguration());            // TODO: An advanced algorithm could be employed here that writes objects            //       related by foreign keys, in the correct order            writer.writeDocumentStart();            for (int idx = 0; idx < model.getTableCount(); idx++)            {                tables[0] = (Table)model.getTable(idx);                writer.write(platform.query(model, "select * from "+tables[0].getName(), tables));            }            writer.writeDocumentEnd();        }        catch (Exception ex)        {            throw new BuildException(ex);        }    }