parser.getNamespaces().declarePrefix(
ns.getPrefix(), ns.getURI());
}
//set validation based on strict or not
parser.setValidating(strict.booleanValue());
parser.getURIHandlers().add(0, new WFSURIHandler(geoServer));
//parse
Object parsed = parser.parse(reader);
//if strict was set, check for validation errors and throw an exception