GH-14 Add xmlDeclaration and fix bug for #text