A five-year-old boy recovering from cancer became a superhero for a day, as San Francisco transformed itself into Gotham City.