Fixes #33 Throws an exception if the first element of the document is not a head-element