$xml = simplexml_load_string($xml);
$fields = array();
foreach ($xml->field as $f) {
$f = (array) $f->attributes();
$fields[] = $f['@attributes'];
}
$dom = new DOMDocument;
$dom->loadXML($xml);
$fields = $dom->getElementsByTagName('field');
$arr = array();
foreach ($fields as $field) {
$arr[] = array(
'name' => $field->getAttribute('name'),
'label' => $field->getAttribute('label');
'size' => $field->getAttribute('size'),
);
}