class X13XmlProcessor {

    public XmlInformationSet process(XmlRegArimaRequest request) {
        // specification
        RegArimaSpecification spec = specification(request);
        Ts s = XmlTs.TS_UNMARSHALLER.unmarshal(request.series);
        if (s == null) {
            return null;
        }
        if (s.hasData() == TsStatus.Undefined) {
            s.load(TsInformationType.Data);
        }
        if (spec == null || s.getTsData() == null) {
            return null;
        }
        ProcessingContext ctx = context(request.context);
        IProcessing<TsData, PreprocessingModel> processing = RegArimaProcessingFactory.instance.generateProcessing(spec, ctx);
        PreprocessingModel model = processing.process(s.getTsData());
        TreeSet<String> set = new TreeSet<>();
        List<String> items = request.getOutputFilter();
        set.addAll(items);
        InformationSet info = InformationSetHelper.fromProcResults(model, set);
        XmlInformationSet xinfo = new XmlInformationSet();
        if (request.getFlat()) {
            xinfo.flatCopy(info);
        } else {
            xinfo.copy(info);
        }
        return xinfo;
    }

}