Assume the main CPU wants to send/receive data to an FPGA chip.
> From the CPU's point of view, it only sends out byte by byte, and
> FPGA vice versa. How does the FPGA distinguish whether this byte
> is a command, parameter of a command, a byte of data, etc?
>
> Can I use the ideas of XML/HTML to do this?
>
You could, but it would be odd.
What you're looking for is a communications protocol, to help you pick out bytes from the bit stream, commands from data, &c. SPI doesn't give you a strong way to distinguish bytes in the bitstream, at least at the receiving end. I'd suggest that you use at least one chip select/framing bit. After that you just need a more or less standard serial protocol that lets you organize your commands and data into packets.
This isn't really a DSP question at all -- this is an embedded computing question. I'm taking the liberty of cross-posting this response over there, where you should have posed the question in the first place.