bugfix in clone

* Bug fixed in clone() which removed the doctype
* Using unicode instead of str to convert to string