This is a topic that is close to the heart of many, and as such, I hope not to offend anyone. I lost a child at 20 weeks, he was a misscarriage, and my wife was able to deliver him naturally. (I am not looking for sympathy). The doctrine of the LDS Church, of which I am part, had great healing and comfort for me. This come from The Book of Mormon, Moroni 8 with select verses below.
5 For, if I have learned the truth, there have been disputations among you concerning the baptism of your little children.
6 And now, my son, I desire that ye should labor diligently, that this gross error should be removed from among you; for, for this intent I have written this epistle.
7 For immediately after I had learned these things of you I inquired of the Lord concerning the matter. And the word of the Lord came to me by the power of the Holy Ghost, saying:
8 Listen to the words of Christ, your Redeemer, your Lord and your God. Behold, I came into the world not to call the righteous but sinners to repentance; the whole need no physician, but they that are sick; wherefore, little children are whole, for they are not capable of committing sin; wherefore the curse of Adam is taken from them in me, that it hath no power over them; and the law of circumcision is done away in me.
11 And their little children need no repentance, neither baptism. Behold, baptism is unto repentance to the fulfilling the commandments unto the remission of sins.
12 But little children are alive in Christ, even from the foundation of the world; if not so, God is a partial God, and also a changeable God, and a respecter to persons; for how many little children have died without baptism!
13 Wherefore, if little children could not be saved without baptism, these must have gone to an endless hell.
14 Behold I say unto you, that he that supposeth that little children need baptism is in the gall of bitterness and in the bonds of iniquity; for he hath neither faith, hope, nor charity; wherefore, should he be cut off while in the thought, he must go down to hell.
15 For awful is the wickedness to suppose that God saveth one child because of baptism, and the other must perish because he hath no baptism.
19 Little children cannot repent; wherefore, it is awful wickedness to deny the pure mercies of God unto them, for they are all alive in him because of his mercy.
20 And he that saith that little children need baptism denieth the mercies of Christ, and setteth at naught the atonement of him and the power of his redemption.
21 Wo unto such, for they are in danger of death, hell, and an endless torment. I speak it boldly; God hath commanded me. Listen unto them and give heed, or they stand against you at the judgment-seat of Christ.
22 For behold that all little children are alive in Christ, and also all they that are without the law. For the power of redemption cometh on all them that have no law; wherefore, he that is not condemned, or he that is under no condemnation, cannot repent; and unto such baptism availeth nothing—
23 But it is mockery before God, denying the mercies of Christ, and the power of his Holy Spirit, and putting trust in dead works.
To summarize, little children are alive in Christ and have no need for repentance, therefore baptism is not necessary for them until they reach the age of accountability. If you have lost a little child, he or she is alive with God and peace should be found. This is how my wife and I were able to find comfort in the loss of our son.