I have a slightly different take on this. I have been "Polishing" my own tanks for many years--diesel is very easy, since the fuel is not explosive--but of course inflamiable. Many diesel boats have built in polishing systems. It was essential for our long distance cruising, since there was always the chance of picking up bad fuel, or water. (We did attemmpt to filter fuel as it was taken aboard and checked the first few gallons in a container). Every 6 months we would run the tanks below half, and transfer all of the fuel to one tank thru the polishing filters. After the tank was "empty" we would unbolt the "man hole" in the top of the tank. We used hand pumps to remove any residual diesel and debris, and then cleaned the inside of the tank bottom with paper towels. The fuel was then pumped back into the other tank thru the filters. Walbro makes pumps for diesel and gas transfer.
I recently purchased a boat which had not been used in 2 years. Fortunately the fuel had StaBil put into the tanks. We had to rebuild the cockpit decks, and I wanted the tanks empty. Since the boat had an outboard, the fuel removal was simple and safe. We hooked up my polishing pump and filters to the hose we disconnected from the outboard. All batteries on the boat were disconnected. We acquired 50 gallon drums to store the gas in. We grounded the boat, tanks and pump together. The single battery running the fuel pump was some distance away, and the switch on the transfer pump (the pump was ignition protected and gasoline rated) was igintion protected. We pumped all of the fuel out of the boat tank thru the filters and water seperator. After rebuilding the deck, we transfered half of the fuel back into the boat, and the other half of the fuel we put into cars, other boats and RV's. We filled the boat tank up and it ran find. Any water and debris was removed during the transfer and filtering process. I would not do this in an inboard boat--and would be sure that any person knew exactly what they were doing, and mitigated the risks of spark, static, and fire.