If you want to use a single Property to track both, you could create two different Views and apply a single predefined filter to each View, to only include traffic to the applicable hostname.
eg View for abc.example
Filter type - Predefined
Include Only traffic to the hostname that are equal to
abc.example
rinse and repeat for the 2nd View, using the applicable hostname for that view (xyz.example)
If you were to want to use different Properties for each, you would need to add a tracking code snippet configured for a multitracker setup
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
gtag('config', 'GA_TRACKING_ID_2');
</script>
and then create the above-mentioned filter for the Views in each Property, so as to restrict the data going to each Property's Views to only include data for the hostname applicable to the specific Property.
eta.. if using the same single GA Property to track both, then be sure to put both domains on the Referral Exclusion list.