It's time for her to be thoroughly examined by a vet. Complete blood work and urinalysis. It could be UTI, but diabetes and chronic renal failure are very common in older cats. As many have said, arthritis is also a common ailment in geriatric cats.
As far as diet, the theory that dry diets with grain CAUSE these problems is NOT supported by the evidence we now have. Cats don't get urinary tract infections from dry cat food.
It is important to provide sufficient water and as cats age and in some other individuals the wet food may be a better choice.
Doug, DVM