In your first example, while I'd prefer with for the preposition, they are both acceptable, and are both interchangeable. Gerunds and infinitives generally function similarly, although sometimes changes in syntax are required. The one you chose will be based on which best fits into the rhythm or voice of your writing.
The second set of examples are a bit more problematic. First of all, unless I'm misunderstanding, the verb should be processes.
The system process processes A [in order] to obtain B, containing C.
The system process processes A [in order] to obtain B, which contains C.
The problem here is that you have a restrictive clause--i.e. one that is needed to modify the word it identifies, which in this case is B--so the appropriate relative pronoun is which, not that. Always use which for restrictive clauses and that for non-restrictive clauses.
Also, in the first of these, containing C is a participial phrase in the present tense. It's also modifying B.
In both cases you need a comma after obtain B, and [result] B is being modified by each.
I think it is usual to use that as a conjunction in these examples.
See the definition that:
7) a subordinating conjunction used to introduce:
So I would write them as follows:
We recommend that you book your flight early.
He recommends that you read the book before watching the movie.
I recommend that you go there.
I suggest that you go to the sport center.
Also check the definition recommend and you can see this form:
4) to advise; counsel; suggest ⇒ "to recommend that something be done"
Best Answer
These two are your best options
or
In the second example, you simply need to change the position of "apologizing" and "for"