private EObject parseCapabilities(final Document document, final Configuration wfsConfig)
throws IOException {
// final Parser parser = new Parser(wfsConfig);
DOMParser parser = new DOMParser(wfsConfig, document);
final Object parsed;
try {
parsed = parser.parse();
} catch (Exception e) {
throw new DataSourceException("Exception parsing WFS capabilities", e);
}
if (parsed == null) {
throw new DataSourceException("WFS capabilities was not parsed");