smartxml: fixing detachment of the document root