I do not propose that I know everything about treating driftwood however I have picked up a few pointers along the way.
Treating driftwood and bogwood is highly recommended if you intend to use your item for anything that involves animals or water coming into contact with the wood, notable examples are aquariums, vivariums and any other cage that keeps animals. There are three main purposes for treatment:
1) To remove chemicals from the wood that would either leak into the water or be consumed if the item was damaged. All types of chemicals can be found in the wood, however the most likely is salt on driftwood but bogwood and items from rivers can contain mainly other chemicals.
2) To remove colourants from the wood called tannins which will leak into a fish tanks water for example and change the water brown, this is both dangerous for the occupants of the tank and can ruin the aesthetics of the display. Tannins are more commonly found in bogwood and river wood and are less likely in driftwood as the wood has been washed in the sea for some time.
3) Finally bacteria that might be on the wood is removed to stop it affecting whatever comes in contact with the wood.
Treatment can be completed in a number of ways each with a separate success rate and time frame and are as follows:
1) Soaking - this is the simplest and most long winded method of treatment, submerge the wood in water and change the water every other day to remove the chemicals and tannins. This is recommended for several weeks and even months, for tannins you need to continue this process until the water remains clear after soaking. Disadvantages of this include the length of time taken to complete and the fact it might not actually be possible to submerge some large pieces.
2) Boiling - this is very similar to soaking but can speed the process up. Notable disadvantages of this include not having a saucepan large enough and the thought that it could weaken the item more.
3) Chemical treatment - it might seem odd removing chemicals with chemicals but seem people choose to do it this way, chemicals include polyurethene and liquid acrylic although in all honesty I wouldn't use it for fish tanks!
4) Cooking - not literally of course but putting your item in a low heated oven can help kill off bacteria on the wood.
Varnish can also be used to treat wood but should not be used for contact with animals.
Below are a few weblinks to forums and sources of other information regarding treatment:
Any questions please ask!