I would be guessing a tape worm of some sort. I have actually had the wonderful experience of tapeworms - it was horrible. There was 3 of us that ate the same thing at a restaurant and all ended up sick with tapeworms. A friend of mine got it by eating a carrot with some dirt on it from the garden... The treatment for this is quite simple - a few pills and the worms are gone. They will probably ask you to collect samples and take them in for processing - just so they can find out if there are others. I got lucky and passed mine - which is not that common. Your child has obviously passed it and could be over it. However get your child checked out to make sure.
When I had them, I could not digest food (they soon gave me B12 - which was supposed to help me digest food - but since tape worms feed off of B12 it did me no good). The day I passed it, I was extremely sick - just about puked the entire day.... it was not good. If your child was sick for the last few days or just had a gut ache - this could have been why.
Thanks, the wife is making an appointment as I type this! I looked into tapeworm and noticed the similarities in appearance. Apparently part of the tapeworms break off and end up in the stool so it could be that.
That is not pinworm. Pinworms are very tiny and are usually seen in a large number. That could be tapeworm or some other sort of large worm. take it to a doctor for sure!!
That is DEFINITELY a worm alright. You may want to keep a specimen to take to the doctor who will be able to identify the type of worm and thus provide the appropriate course of treatment.
BTW, click the images to enlarge.