As has been said, knowing *exactly* which engine and ignitor you have is important, there's a helluva lot of different setups for the XT engine. For starters, there's models with CDI, that you can happily run without battery, and models with TCI that will require a battery to run.
If the wiring diagram you have doesn't make sense for the colours of the wires coming out of the bits you have, then there's a good probability you have the wrong diagram, which won't help...
For example, I've attached a snip of the wiring diagram for my XT550 (it's labelled in Italian, but hey), from which we can see not only the colours of the loom wires (B/W, O and B from the CDI, the rest are component to component interconnects), but also the colours of the wires coming from the CDI itself (W/G, G, W/R, Br, R, B/W, O and B). In this case, we can see that I would need to connect green to green, white/red to white/red etc. It also shows the plugs, sockets and bullet connectors, as well as their genders - we can see that the sensor coil connections from CDI to alternator have a female CDI end, male alternator end, and that the red and brown (ignition source coil, FWIW) and black connections are male bullet connectors at the CDI end, whereas black/white and orange are female at the CDI end.
Exact wiring diagrams are available from various places on the net, but we'd need exact references to point you to the one you want.