With XTs the age of yours the wiring and connectors will almost certainly be past their best. It is well worth going over all the connectors and checking for corrosion and poor contact, including the battery and coil connections (HT and primaries). Particularly check the multiplug on the main relay unit behind the right hand side panel. This can be the cause of a lot of weird electrical gremlins.
When you disturb connectors that have been in place for a long time they almost always don't reconnect cleanly. Break and remake them, cleaning as you go. Brake cleaner and a toothbrush are very effective.