In my mind this is both (1) extremely brittle and (2) just not the right way to do this. (And I know you agree given your comment.) Is there not a way to say "if request.body parses as XML then do this stuff, otherwise use PushForm"? To me that's the right entry point for this logic