I doubt if they give all stack layers in open source but even if they do, what your goal really is? Build a standard of your own? Because even if you could modify the stack, how would you know that you didn't mess something up from ZigBee specification? In this way you would loose ZigBee certification and build something that has no recognition from no one. Except of course if your experience on ZigBee specification is so important, that you could build a stack of your own. But even then, you would need to take certification from the alliance.
If you mean something else that I didn't quite unerstand, please elaborate.