Complex sentence: The technique was popular in the Middle Ages in Europe to produce fruit inside the walls of a typical castle courtyard without interfering with the open space, and to decorate solid walls by such trees planted near them.
Split into simpler sentences: The technique was popular in the Middle Ages in Europe to produce fruit inside the walls of a typical castle courtyard without interfering with the open space. And to decorate solid walls by such trees planted near them.