Hmmm, I don't mind having this function and using `xmlDocSetElement` as long as we're checking the return value of it to unlink and free it if it was non-nil.  

We *could* just unlink it and return it to the caller, but then the caller would have to worry about freeing it.  Since the scenario where you'd want to swap a root element seems rather unlikely, I figure having `SetRoot` free the existing root and just tossing it off would be sufficient for most cases and prevent many a possible memory leak for users of the library.

@jbowtie what do you think?