Can we implement our own stack in any of XBee modules?

Can we implement any other open source stacks like ZBOSS etc. in XBee modules? I want to customize the stack, so which XBee modules are suitable for this?

You can write and upload your own code to either the XBee 802.15.4 modules which is a freescale based product or the XBee ZB modules which are an Ember based module. Depending on if the manufactures of the listed processors have a stack or not is what determines which one you would need to use. Just understand that when you go this rout, the FCC certification is removed and you will need to re-certify the product.