How do you catch uxie on Pokemon pearl?

There are 3 of these legendary Pokemon, UXIE, MESPRIT and AZELF. They are all in caves in the middle of the 3 lakes (see your town map).

Before, though, you have to defeat/catch Diagla/Palkia, after which they appear in the caves, you have to use surf to get to the caves.

At lake Acuity by snowpoint city, you can find UXIE. AZELF is found in Lake Valor near Pastoria City. MESPRIT is in Lake Verity near twinleaf town.

UXIE and AZELF are much easier to catch as they only battle with you (you can use a max ball or paralyze them/put the to sleep) Whereas MESPRIT runs away and you have to follow it, you need the tracker pad to do this (pokedex app). If you go near it it will run away so you have to wait for it at a point where any route ends and another begins, it takes a while but eventually MESPRIT will end up there and you can battle it.

NOTE: MESPRIT can run away from any battle even when put to sleep.