I guess you have to seek legal advice first if you need to have an agreement on certain aspects like custody of the child, financial matters, distribution of properties, etc. If both of you have agreed to it, then there shouldn't be a problem since you know that both sides will cooperate. If not, there are also legal insitutions that offer services in case you would need to file a case especially if there is violence involved.