How long is her hair - just how matted is it getting?
Tying up, plaiting and a swim cap would be your best option.
Then if very young no knots children's shampoo and a wide toothed comb, or if older Id use conditioner first and a wide toothed comb, then shampoo and conditioner again.
Or if it gets very, very matted Id rinse it, apply a leave in conditioner / hair mask like the Aussie one in the big pot and put her hair in a hair turban before getting dressed and sorting it properly at home.