Sure, A 9-hour stopover is just enough to visit the Great Wall at MuTianYu Section.

the CA866 depart on 17:30 from Madrid, Spain

Landing at Beijing PEK airport on 10:25;

taking around 1 hour to pass the border control and meeting with our driver on around 12:00;

arriving at MuTianYu Great Wall on around 13:30;

departing back on around 15:45, and arriving back at PEK airport on 17:00.

around 2 hours for sightseeing on the great wall.