Trade is a little trickier to handle, and I think the notions of personal bodily risk and martial skill will be helpful in determining whether or not to give XP for wealth gained through trade.
Two polarized scenarios present themselves immediately.
The first is a wealthy merchant living in Milan. He inherited an estate, a large sum of coin, and five ships from his father. Now, obviously he does not level for his inheritance.
But neither should he level from the profits he reaps from shipping finished suits of armour to England. There is no factor of personal bodily risk, and no application possible for martial skill.
Medinan Caravan Leader
The other is a caravan leader from Medina, carrying spices to Egypt. The caravan leader personally accompanies every caravan, and plays a part in defending the camel train from the numerous bandits on the way.
In this case, the caravan leader has taken on personal bodily risk, and demonstrated martial skill. These are the things which are being represented by the XP for gold mechanic, and therefore the caravan leader should be receiving XP towards his character class not only for the bandits killed and driven off along the way, but for the net profits reaped by the sale of the spices.
Note that only the net profits should be used for the calculation - otherwise you're potentially giving XP out for the same gold twice! Imagine our leader had obtained 1000gp from a dungeon delve (and received XP), sunk that whole 1000 into a caravan laden with spices, and sold the whole lot for 1250 in Egypt. Our dusty caravan leader would only get 250XP for the sale, as he's already received XP for the initial 1000gp investment.
I think that by applying the tests of personal bodily risk and demonstration of martial skill, the GM should be able to intelligently make rulings on grey areas. Consider on one hand a trade route where a caravan is almost certain to be waylaid by well-armed and organized bandits or dangerous monsters, and another where there is no risk of banditry or creatures, and interpolate between the two.