/** * @param SimpleXMLElement $xml * * @return ProductConfiguration */ public static function createFromXML(SimpleXMLElement $xml) { $productConfiguration = new self(); $children = $xml->children(); if (isset($children->deliveryMethod)) { foreach ($children->deliveryMethod as $deliveryMethodXml) { $productConfiguration->addDeliveryMethod(DeliveryMethod::createFromXML($deliveryMethodXml)); } } return $productConfiguration; }