RAMALLAH, West Bank (AP) — Palestinian factions Hamas and Fatah agreed in Beijing to form a government together, the groups said Tuesday, in the latest attempt at resolving a longstanding rivalry that looms over any potential vision for the rule of Gaza after the war with Israel.