Fix SYSTEM-only doctype serialization
Fix escaping of doctypes with quotes in them