MarkLogic normally doesn't allow creating documents with multiple root elements, though I am not sure it is guaranteed it can't. There are however known circumstances in which you can end up with multiple documents having identical database uris.
One way is to create two forests for one database, disconnect the second, insert a document, replace first with second forest, then insert same doc again. After that, connect both forests, and you will have the same doc twice at the same database uri, but in a different forest. This shouldn't be possible with just one forest.
How to get rid of these? Loop over doc()[count(doc1) > 1]/base-uri(), and then reinsert those documents. If you pull the value from the database, you will have to decide which doc node is to be preserved, and that might not be easy. You might also want to check how many docs are involved in this situation. You will want to batch up the reinsert if it is over (a few) thousand documents..
HTH!