Aircraft: B737
Phase of flight: Cruise
Anomaly: Aircraft Equipment Problem Critical

At FL340; with autopilot autothrottle on; and Left Center Pump off/cross feed open 700 LBS in center tank we experienced Number 2 Engine rollback and autothrottles disengage. Recognized engine failure and Captain assumed control of aircraft. Declared emergency with Center and began drift down descent to FL290. Executed Engine Fail Checklist from QRH. Started APU. Attempted engine in flight start; which failed. Noticed spar valve was not opening and no indication of fuel flow on start attempt. Attempted second start attempt at FL220 with same result. Secured engine per checklist. Notified cabin crew to perform emergency briefing for divert into [a nearby airport]; maintained FL200. Decided nearest suitable airport to be ZZZ based on longer runway; better breaking action report; lower landing weight; better familiarity. Obtained weather and performance numbers from Dispatch for [the divert airport]; all within flaps 15 limits. Planned and briefed flaps 15 landing and executed Single Engine Descent checklist. Notified passengers of divert. Executed Single Engine Approach checklist and again obtained current weather and breaking action reports; still within limits. Executed Single Engine Landing checklist for RNAV approach autobrake max. Landed overweight by approximately 1;500 LBS breaking action good. Clear of runway requested exterior inspection from emergency response personnel; who reported no abnormalities. Taxied to gate. LNAV/VNAV engaged with autopilot/autothrottle engaged. The Number 2 Engine flamed out and rolled back. This caused a slight yawing motion and the AT disengaged. No fuel flow or EGT was indicated. The engine was wind milling with no vibration noted. I was the pilot not flying; and recognized the failure first as my First Officer had his dinner on his lap. I took control of the aircraft; applied rudder to control yaw and switched the autopilot to my side. I remained in control/pilot flying until arrival at divert airport. An in flight emergency was declared with Center; and lower altitude was obtained for drift down. The Engine Failure and Shutdown Checklist was started; and we did attempt an inflight start with no fuel flow or EGT indicated. We also noticed the Spar Valve remained in the closed position after the start lever was raised to idle. We were still outside the in-flight start envelope. We then contacted Dispatch and filled them in on the details and received weather and braking action reports for [two nearby airports]. Analyzing this information; we decided to proceed to ZZZ/Re-Dispatch as the weather was about the same (VFR); but the breaking action reports was better; runway longer; lower weight due fuel burn; more familiar with Airport; and a bigger fire/rescue infrastructure in place. We were cleared direct [a nearby] VOR to maintain at or above 14;000 FT by Center. By now; drift down stabilized at FL200; and we ran the above mentioned checklist again as we were within the in-flight start envelope with the same results. Cabin crew was notified about our situation and plan and was told to prepare the cabin and do another safety briefing. A cabin PA was also completed at this time to complement/explain the additional flight attendant briefing and the planned landing in ZZZ. At that time we had about 35 minutes to landing. Decent Checklist was completed; the RNAV Flaps 15/autobrake maximum was briefed as well as the expected (737-900 flaps 15) over-weight landing at 145.5K. Approach Checklist was completed per QRH. We were cleared for the requested approach and landed without incident. Updated weather and performance was provided by Dispatch. The runway environment was in sight at the FAF with some very light snow. Braking action was good. After exiting the runway; we asked the Fire/Rescue Crew to check our brakes due to the maximum braking effort with no adverse findings. Another PA was completed explaining the event in more detail while this was being completed. Taxi to gate without incident. B737NG flight crew experiences an engine failure at FL340. Indications are that the spar fuel valve has closed uncommanded. Attempts to restart the engine during descent are unsuccessful and the flight diverts to a suitable airport.