Constipation
Chronic constipation accounts for an average of 3-5% of a pediatric office visits. It is common during a child's first year of life, and even more common between the ages 2 and 4. Insufficient fiber and water in a diet, improper toilet training, and an intentional "holding" of the feces by the child,- are the issues which cause this condition, and must be addressed first. Miralax is an excellent, non-addictive, and easy-to-use medication, but it is not always necessary. See the link below for more information:
http://digestive.niddk.nih.gov/ddiseases/pubs/constipation_ez/
Soiling
As a diagnostic consideration, fecal soiling (encopresis) should be considered in children above 4, who pass their stools in places other than a potty or a toilet bowl. It is often associated with constipation, especially due to an intentional fecal retention (holding). An aggressive therapy of constipation, and toilet training are usually sufficient treatments. See links below for details:
http://kidshealth.org/parent/emotions/behavior/encopresis.html
http://www.healthychildren.org/English/health-issues/conditions/emotional-problems/pages/Soiling-Encopresis.aspx