A child is in hospital with life-threatening injuries after she and five others were hurt when shots were fired outside a church in London where a funeral was taking place.