Multiple Fetch Xml Statements with Or Filter in Portal Web Template

In a recent project, we had a requirement to display cases to the portal that are associated with either Contacts or Accounts. Our case entity had a related entity called Case Contacts, and our account entity had a related entity called Account Contacts. The account entity had a list of all the cases associated with the account.