condition resource xml and json formatting.  needs testing