public static function fromXML(SimpleXMLElement $xml) { $th = new ForwardProxy(); $th->setHost((string) $xml->proxyHost); $th->setPort((string) $xml->proxyPort); $th->setUser((string) $xml->proxyUser); $th->setPass((string) $xml->proxyPass); return $th; }