Writing the data source content to XML

You can also write the content of the data source to an XML file like this:
datasource.output("network.xml");
You can also use a java.io.Writer . The following example prints the data source to the default output:
Writer writer = new PrintWriter(System.out);
dataSource.output(writer);
writer.flush();
See also Advanced parsing and writing of a data source for details on more advanced functionality.