It's very scary and you did the right thing. The toxicity levels for xylitol and dogs are really low. Many people don't know this.
We only knew ddog had eaten chewing gum from dds pocket when we found the wrapper on the floor. As it turns out he had eaten almost a full box of Wrigleys and would definitely have been dead had we not realised.