there is a function called 'auto-chromatic' in the XL.
check the manual for the specifics, but basically it's a button that shows up that says 'auto' when you have a sample selected, i think in PGM edit.
you hit that button, then choose a 'root' key (c1 is good), then it creates a new program with that one sample mapped out as far as the mpc can take it. you can then play it like a piano.
be aware, at pad c1 as the root key, pads a1-a8 will all be the same, as will pads c9-c16...don't quote me on those exact numbers, but suffice it to say, the extreme top and low end will just all be the same note as the xl can't pitch things that high/low.
another way to be able to play a melody out of a sample is to use '16 levels' set to tuning, this gives you about an octave and a half to work with (16 notes), but it is cool because you can do it all on just one pad.