Is XM shared across players?
Solution 1:
YES, XM is shared across players.
When XM is consumed by a player, it is not available for other players until a certain time.
Solution 2:
There seems to be some delay after you grab the XM before it will disappear on another scanner. It appears to be around 60 seconds.
If two (or more) agents are walking together, they will pick up the same XM. Even if one client scans the new XM before the other and picks it up, all of the XM still spawns for every player.
So, to answer the question: You pick up XM, but it lingers around for about a minute to allow others to also pick it up.
Solution 3:
XM is only shared with players to a certain degree.
It seems to have no unique ID and is not necessarily synchronized with the game servers. You can set you phone to airplane mode (turn connection off) and collect the same XM on a given spot with multiple players.
If you don't turn your connection off, however, it will be gone.
Note: I have no idea if this is intended or encouraged behavior by Niantic, some people might call it cheating.