M.S.
In order to prevent this from being an issue for the next several years (once a child has become constipated, they may hold it to prevent the pain/discomfort, which begans the vicious cycle that believe it or not can plague them for years to come). Right now, you don't want anything habit forming to be given to her to make her go poop- at least not on a regular basis. Your Dr. may want you to do a few enama's to clean her out (do this ONLY if your Dr. recommends it) then, you'll want to A) give her foods that will make and keep her poop soft and B)per your Dr. a safe non habit forming laxative like Miralax. If your Dr. isn't familar with kids holding in their poop and what can happen (for example, encopresis) - then seek the advice of a specialist. Trust me, you want to catch this early. Once a child holds their poop for a extended amount of time, their poop becomes impacted, stretches out the colon and then although full of poop, they are unable to poop.
Speaking from experience here, my daughter started out just like yours, only a little bit younger and didn't get better (in fact extremely worse) until after turning 5 years old. She is 7 now and doing great but I have to stay on top of it or we could easily go back to the "good" ol days.
Best wishes,
M.