Welcome to the forum!
Unfortunately, there is no simple replacement for the TDI ignition module that I know of. There are a lot of threads on here and on the xs650.com board that discuss these ignition modules though. I can suggest a few things that you might do:
1. Search for and read the threads on visually inspecting the TDI module you have. Folks have had some luck with reflowing old solder joints and replacing obviously burned-up components that have gone bad over time.
2. Start looking around for a good used module to buy and try out.
3. There are a few threads about folks searching for modules used on other bikes that might be retrofitted, but those all seem to end with no resolution. They are good reading though as it might give you some ideas.
4. If nothing else works out, you can try buying the used parts and installing the points type ignition from an older model bike. This might be a bit involved, but you will get a running bike.
Let us know how you make out as we all can learn even if things don't work out on the first go.