Wal-Mart has reported its first decline in profit for a decade, with earnings hit by the sale of its German unit, high energy prices that put pressure on US sales and increased costs in the retailer's home market.