In my personal experience, I have been shocked to see plants that looked utterly dead, dead, dead, come back... at times even months later if they had enough time to create even a minor root system in their current home - the key to all of these resurrections was FREQUENT watering (as in never really dried out, but not flooded either), so they did not have to work hard to get hydrated, and could put their energy into pushing new shoots. Now some are weakened beyond a point of being able to produce fruit in the future, but give them time and see. I have a guanabana that has been attacked by disease repeatedly, and continues to try to push new shoots even though it has not had a successful leaf in about 6 months. It was a 15-gal tree, and now the only living part is a 2-inch stump, but I admire its determination so I keep watering it.
I do find that most that no longer pass the scratch test are done for, but when a plant first loses its leaves, there is still something you can do to give it a shot at recovery. You also of course have to remedy whatever the problem was in the first place - and in your case since it was transplanting, you don't want to move it around again and cause it more trauma (unless of course the issue is that it was put in a place that was too harsh for it to begin with, in which case put it somewhere healthier without harming any of its roots).
Take a look though at what caused this transplant shock, so you can learn from it and not repeat in future. Did you sever a tap root? Did you not give the plant enough water for the number of leaves it had, so it could have time to adjust to its new home? Did you cut through a lot of roots and then not cover them properly with the new soil, or perhaps do the opposite and plant the plant too deep versus the amount of dirt covering it had before? Did you shock it with full sun or full shade without a period of hardening off? If it was root-bound, did you take the time to carefully separate and spread all the roots outward before planting? Did you plant it in soil that was just too much of a sock to the system, or put it in bare-rooted without giving it nutritious soil to draw from in its immediate vicinity? Or maybe you tried to fertilize, or over-water it, right away? Did you plant it with a huge leaf system without pruning back a bit so it could take its time growing roots, and then under water?
It's worth considering what could have been done differently, because most transplant shock, or even long-distance shipping shock, can be avoided. If you consider what caused the plant to get sick, you have a much better chance of rectifying that problem and nursing it back to health. I send my regards to the guava, and hope it gets well soon!
Guavas are usually pretty hardy, and can often produce new buds in a week or two after having lost them all, if they have adequate conditions. Many guavas have recovered from a state of no leaves to make new leaves and do just fine, so depending on what happened to make the plant appear to die off like that, it has a good shot of recovering fully and still producing fruit - more at least that some other species which are a lot more delicate. Guavas are in fact considered invasive in Florida because they are so resilient and hard to kill!
A dying tree needs some special care, though. Remove all the dead leaves so nothing is draining the plant of its energy, and there is room for new ones to grow. Consider pruning back the plant a bit if it has a large branch system to send energy through. If the tree has a lot of old dead bark, gently remove as much as you can, without wounding the green part of the tree, to help it to breathe and grow unhindered - it takes a lot of energy to push leaves through thick hard dead bark - too much for a weak plant to be able to afford. If you notice new buds starting, let several of them produce, but then when you have more than one stable strong leaf, remove any leaves that are growing out of the base or too low on the tree, to encourage it to push the energy further up into leaves that are on the branches, rather than at the root base. Just make sure there are others, because the plant does need to be able to produce its energy from somewhere, and the base is better than nothing - but if it doesn't send life up through the ends of the branches soon, those areas will die off due to lack of blood coursing through their veins, so to speak.
Good luck, and let us know!