final Parser parser = new Parser(wsConfig);
final Object parsed;
try {
parsed = parser.parse(capabilitiesReader);
} catch (SAXException e) {
throw new DataSourceException("Exception parsing WFS 1.1.0 capabilities", e);
} catch (ParserConfigurationException e) {
throw new DataSourceException("WFS 1.1.0 parsing configuration error", e);
}
if (parsed == null) {
throw new DataSourceException("WFS 1.1.0 capabilities was not parsed");
}
if (!(parsed instanceof WFSCapabilitiesType)) {
throw new DataSourceException("Expected WFS Capabilities, got " + parsed);
}
return (WFSCapabilitiesType) parsed;
}