patterns in xml and json