In WPF, XAML is used as a user interface markup language to define UI elements, data binding, eventing, and other features.