refactor serializer so that xml-attributes are never added to the stack
debugged and fix formula stack issue