Share tests for createElementNS and createDocument.

As requested by @plehegar.