I had had the court documents from years ago stating that I had sole custody.
It was suggested to me by another immigration forum that I should have something more recent, so I had my ex go to a notary and have a "letter of permission" drawn up and notarized. It was a brief letter that basically supplied his name, my name and my future husband's name and my daughter's of course. In it he stated that he was fully aware and amenable to the fact that Alli would be living in the USA with me and her new step-father, had his permission to travel freely but that my ex would retain vistation right as agreed "by mutual consent". Gave his address and phone number as well as ours, signed it and had the notary sign, date and put a red seal on it.
I have used this letter for crossing the border (back and forth for 3 years now), added a copy of it with my adjustment of status application when I applied and never had a single problem with it.
I say get a letter notarized if you can.