title: Displaying Object as HTML and XML
body: <p>I have a class certificate which in turn has different objects like TradingMarket is an Object, Currency is an Object and Issuer is an Object.</p>
  
  <p>Now I want to display this complete information as XML and HTML. being new to PHP programming I have no clue how to do these both operation in a better way.</p>
  
  <pre><code>class Certificate {
        private $isin;
        private $tradingMarket;
        private $currency;
        private $issuer;
        private $issuingPrice;
        private $currentPrice;
  
        public function __construct($isin, $tradingMarket, $currency, $issuer, $issuingPrice, $currentPrice) {
            $this-&gt;isin = $isin;
            $this-&gt;tradingMarket = $tradingMarket;
            $this-&gt;currency = $currency;
            $this-&gt;issuer = $issuer;
            $this-&gt;issuingPrice = $issuingPrice;
            $this-&gt;currentPrice = $currentPrice;
  
        } 
  
        public function setTradingMarket($tradingMarket) {
            $this-&gt;tradingMarket = $tradingMarket;
        }
        public function getTradingMarket() {
            return $this-&gt;tradingMarket;
        }
  
        public function setCurrency($currency) {
            $this-&gt;currency = $currency;
        }
        public function getCurrency() {
            return $this-&gt;currency;
        }
  
        public function setIssuer($issuer) {
            $this-&gt;issuer = $issuer;
        }
        public function getIssuer() {
            return $this-&gt;issuer;
        }
  
        public function setIssuingPrice($issuingPrice) {
            $this-&gt;issuingPrice = $issuingPrice;
        }
        public function getIssuingPrice() {
            return $this-&gt;issuingPrice;
        }
  
        public function setCurrentPrice($currentPrice) {
            $this-&gt;currentPrice = $currentPrice;
        }
        public function getCurrentPrice() {
            return $this-&gt;currentPrice;
        }
  
        public function displayAsHtml() {
         //?????????
        }
  
        public function displayAsXml() {
          // ???????????????????
        }
  
    }
  </code></pre>