urn:schemas-upnp-org:service:Layer3Forwarding:1 urn:upnp-org:serviceId:L3Forwarding1 /L3F.xml /ctl/L3F /evt/L3F */ use SimpleXMLElement; class Service { protected $serviceType; protected $serviceId; protected $scpdUrl; protected $controlUrl; protected $eventSubUrl; public function __construct(SimpleXMLElement $spec) { $this->serviceType = (string)$spec->serviceType; $this->serviceId = (string)$spec->serviceId; $this->scpdUrl = (string)$spec->SCPDURL; $this->controlUrl = (string)$spec->controlURL; $this->eventSubUrl = (string)$spec->eventSubURL; } public function __toString() { return sprintf("Service: %s [%s]\nControl URL: %s\nEventSub URL: %s\nSCPD URL: %s\n", $this->serviceId, $this->serviceType, $this->controlUrl, $this->eventSubUrl, $this->scpdUrl ); } }