The Hot Standby Router Protocol (HSRP) is an IP routing redundancy protocol designed to allow for transparent failover at the first-hop IP router. HSRP provides high network availability, because it routes IP traffic from hosts on networks without relying on the availability of any single router. HSRP is used in a group of routers for selecting an active router and a standby router. (An active router is the router of choice for routing packets; a standby router is a router that takes over the routing duties when an active router fails, or when preset conditions are met.
HSRP is handled a little differently With IOS XR. With IOS you configure your standby commands under the interfaces; in IOS XR you use ROUTER HSRP.
In below example we will configure HSRP for PE1 and PE2 interface gig0/0/0/1 and will use subnet 10.1.1.0/24
1st we will configure IP address to interface on PE1 and PE2: