There is an error in CS3 help docs regarding insertChildBefore().
var xml:XML =
item burger /item
item soda /item
xml.insertChildBefore(xml.bar, saleItem fries /saleItem );
xml.bar would actually return undefined and trace(xml) would not output as Help Docs state.
What should be in place is xml.item