Best XC riding position
Feet on the pedals, hands on the handle bars, one or two fingers on your brake levers would be a base position.

If you're doing something technical, then bum off the seat or at least unweighted, with pedals fore-and-aft.  Doesn't matter which pedal leads, but it'll probably be your primary side, right foot for those who are right handed.

Pedaling when you are able to helps maintain momentum.  Pedaling on a downhill may feel redundant but it gets you up to speed faster.  

On a long climb sit forward in the saddle and lean forward to keep your center of mass forward.  If it gets too steep and the front wheel starts lifting on the downstroke, stand up and lean forwards.  You can get your stem right up close to your crotch and still pedal uphill.

For downhill you want the opposite, to have your weight back.  The skilled and truly insane drop their seats and can essentially put their arse on the rear tyre while riding.  This reduces the chance of doing an end over end, over the handlebars should the front wheel drop into a hole.

Cornering - There are plenty of different opinions on cornering technique, as per comments below.

Cornering depends a lot on the surface.  If its hardpack treat it like a road and lean in, raising the inside pedal and pushing down on the outside one.  If the surface is looser you should unweight the front wheel by leaning back a little through the corner.  Lean the bike a bit more to get the knobbly shoulder bumps of the tyre biting the ground surface.  The rider should not lean as much as the bike leans.

That's a start, I'm sure the offroaders here can expand on points.

On hindsight this answer is somewhat facetious, so please use comments to clarify.