<?php

$json = <<<__JSON
{
    "barcode": {
        "message": "<?xml version=\"1.0\" encoding = \"utf-8\"?><PrintLetterBarcodeData name=\"ABCD\" gender=\"FEMALE\" yob=\"1964\"/>",
        "format": "PKBarcodeFormatQR",
        "messageEncoding": "iso-8859-1"
    }
}
__JSON;

$json = json_decode($json);
$xml = simplexml_load_string($json->barcode->message);
echo $xml['name'].' '. $xml['gender'].' '. $xml['yob'];
