class RemoveDocumentSetTransformer {

    public RemoveDocumentSet fromEbXML(EbXMLRemoveObjectsRequest ebXML) {
        if (ebXML == null) {
            return null;
        }

        RemoveDocumentSet request = new RemoveDocumentSet();
        request.getReferences().addAll(ebXML.getReferences());
        request.setDeletionScope(ebXML.getDeletionScope());

        if (ebXML.getId() != null){
            String id = ebXML.getId();
            QueryType queryType = id == null ? QueryType.SQL : QueryType.valueOfId(id);
            if (queryType == null) {
                return null;
            }

            Query query = createQuery(queryType);
            query.accept(new FromEbXMLVisitor(ebXML));
            request.setQuery(query);
        }
        return request;
    }

    public  RemoveDocumentSetTransformer();

}