doc[0]; $solrDoc->clear(); foreach ($solrXmlDoc->field as $field) { $solrDoc->addField(strval($field['name']), strval($field)); } return $solrDoc; } }