public static function fromXML(SimpleXMLElement $xml)
 {
     $th = new TargetHost();
     $th->setAuthentication(Authentication::fromXML($xml->authentication));
     $th->setUrl((string) $xml->url);
     $th->setSite((string) $xml->site);
     if ($xml->forwardProxy) {
         $th->setProxy(ForwardProxy::fromXML($xml->forwardProxy));
     }
     if ($xml->connectionParameters) {
         $th->setConnectionParameters(ConnectionParameters::fromXML($xml->connectionParameters));
     }
     return $th;
 }
 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;
 }