SourceOutputStream stream = SourceOutputStream.getStream(
_configName, _overwrite);
Set<String> classSet = new HashSet<String>();
classSet.addAll(_classes);
ConfigParser parser = new ConfigParser();
parser.addExcludedFile(new File(_configName).getCanonicalPath());
parser.parseConfigFile(ConfigParser.DEFAULT_SYSTEM_ID, classSet);
if ((_prefix != null) && (_prefix.length() > 0)) {
parser.addPackagePrefix(_prefix, classSet);
}
OutputStreamWriter writer = null;
try {
writer = new OutputStreamWriter(stream);
XmlOutput.outputXmlTree(parser.getTree(), writer);
} finally {
if (writer != null) {
writer.close();
}
}