Fix publicidentity XML parsing issues