How can I export all my private keys using bitcoind?
You could send the dumpprivkey JSON-RPC call to the client.  It takes a single parameter of BitcoinAddress to reveal the private key for that specific address.

To export all private keys for all addresses, you would have to call listreceivedbyaddress to list the addresses and then call dumpprivkey for each.

See:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list