title: Fetch the required element from xml in the form of string
body: <p>I am getting this xml SOAP response:</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;SOAP-ENV:Header/&gt;
  &lt;SOAP-ENV:Body&gt;
      &lt;ns2:AvailabilityResponse xmlns:ns2="http://www.derbysoft.com/doorway" Status="Successful" Token="87348a9665ffc984abf37329"&gt;
          &lt;ns2:Availabilities&gt;
              &lt;ns2:Availability CurrencyCode="USD" HotelCode="HY-CHIRC"&gt;
                  &lt;ns2:GuestCount AdultCount="1" ChildCount="0"/&gt;
                  &lt;ns2:RoomTypes&gt;
                      &lt;ns2:RoomType RoomTypeCode="KING" RoomTypeName="1 King Bed"&gt;
                          &lt;ns2:RoomTypeDescription&gt;1 King Bed; 1 Grand Bed:Ihome Station:Large Plasma Tv:; Large Workdesk:Comp Gym&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="DLXK" RoomTypeName="High Floor King"&gt;
                          &lt;ns2:RoomTypeDescription&gt;High Floor King; Guaranteed High Floor-25th and Up:350 Sq Ft; 1 King Grand Bed:Oversized Workdesk:Free Wifi&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="VW1K" RoomTypeName="Premium View King"&gt;
                          &lt;ns2:RoomTypeDescription&gt;Premium View King; 1 King Bed:Ihome Station:Large Plasma Tv:; Large Workdesk:Comp Gym&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="CLBK" RoomTypeName="Regency Club King"&gt;
                          &lt;ns2:RoomTypeDescription&gt;Regency Club King; Comp Contl Breakfast:Hors D Oeuvres and Dessert:; Exclusive Club Lounge With View&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="QNQN" RoomTypeName="2 Queen Beds"&gt;
                          &lt;ns2:RoomTypeDescription&gt;2 Queen Beds; 2 Queen Grand Beds:Ihome Station:Plasma Tv:; Large Workdesk:Comp Gym&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="VW2Q" RoomTypeName="Premium View 2 Qen"&gt;
                          &lt;ns2:RoomTypeDescription&gt;Premium View 2 Qen; 2 Queen Beds:Ihome Station:Large Plasma Tv:; Large Workdesk:Comp Gym&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="CLBD" RoomTypeName="Regency Club 2 Double Beds Bd"&gt;
                          &lt;ns2:RoomTypeDescription&gt;Regency Club 2 Double Beds Bd; Comp Contl Breakfast:Hors D Oeuvres and Dessert:; Exclusive Club Lounge With View&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                      &lt;ns2:RoomType RoomTypeCode="DLXD" RoomTypeName="High Fl 2 Double"&gt;
                          &lt;ns2:RoomTypeDescription&gt;High Fl 2 Double; Guaranteed High Floor-25th and Up:350 Sq Ft; 2 Double Beds:Oversized Workdesk:Free Wifi&lt;/ns2:RoomTypeDescription&gt;
                      &lt;/ns2:RoomType&gt;
                  &lt;/ns2:RoomTypes&gt;
                  &lt;ns2:RatePlans&gt;
                      &lt;ns2:RatePlan RatePlanCode="49584IPRTF" RatePlanName="Partner Rate"&gt;
                          &lt;ns2:RatePlanDescription/&gt;
                          &lt;ns2:CancelPolicy NonRefundable="false"&gt;
                              &lt;ns2:Description&gt;CXL 24HRS PRIOR TO ARRIVAL TO AVOID 1NT PNLTY&lt;/ns2:Description&gt;
                              &lt;ns2:CancelPenalties&gt;
                                  &lt;ns2:CancelPenalty MaxHoursBeforeCheckIn="24" MinHoursBeforeCheckIn="0" Nights="1" NoShow="false"/&gt;
                                  &lt;ns2:CancelPenalty Nights="1" NoShow="true"/&gt;
                              &lt;/ns2:CancelPenalties&gt;
                          &lt;/ns2:CancelPolicy&gt;
                      &lt;/ns2:RatePlan&gt;
                      &lt;ns2:RatePlan RatePlanCode="49584WPAWAF" RatePlanName="Bed And Breakfast"&gt;
                          &lt;ns2:RatePlanDescription/&gt;
                          &lt;ns2:CancelPolicy NonRefundable="false"&gt;
                              &lt;ns2:Description&gt;CXL 24HRS PRIOR TO ARRIVAL TO AVOID 1NT PNLTY&lt;/ns2:Description&gt;
                              &lt;ns2:CancelPenalties&gt;
                                  &lt;ns2:CancelPenalty MaxHoursBeforeCheckIn="24" MinHoursBeforeCheckIn="0" Nights="1" NoShow="false"/&gt;
                                  &lt;ns2:CancelPenalty Nights="1" NoShow="true"/&gt;
                              &lt;/ns2:CancelPenalties&gt;
                          &lt;/ns2:CancelPolicy&gt;
                      &lt;/ns2:RatePlan&gt;
                  &lt;/ns2:RatePlans&gt;
                  &lt;ns2:RoomRates&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="KING"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="238.480" AmountBeforeTax="203.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="DLXK"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="258.430" AmountBeforeTax="220.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="VW1K"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="278.390" AmountBeforeTax="237.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="CLBK"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="303.340" AmountBeforeTax="258.400" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="QNQN"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="238.480" AmountBeforeTax="203.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="VW2Q"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="278.390" AmountBeforeTax="237.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584IPRTF" RoomTypeCode="CLBD"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="303.340" AmountBeforeTax="258.400" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="KING"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="268.410" AmountBeforeTax="228.650" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="DLXK"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="278.390" AmountBeforeTax="237.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="VW1K"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="298.350" AmountBeforeTax="254.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="QNQN"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="258.430" AmountBeforeTax="220.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="DLXD"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="278.390" AmountBeforeTax="237.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                      &lt;ns2:RoomRate RatePlanCode="49584WPAWAF" RoomTypeCode="VW2Q"&gt;
                          &lt;ns2:Rates&gt;
                              &lt;ns2:Rate AmountAfterTax="298.350" AmountBeforeTax="254.150" EffectiveDate="2016-05-12" ExpireDate="2016-05-13"/&gt;
                          &lt;/ns2:Rates&gt;
                      &lt;/ns2:RoomRate&gt;
                  &lt;/ns2:RoomRates&gt;
              &lt;/ns2:Availability&gt;
          &lt;/ns2:Availabilities&gt;
      &lt;/ns2:AvailabilityResponse&gt;
  &lt;/SOAP-ENV:Body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now I just want to get the 'CancelPolicy' element in the form of string. Also, I don't want all the CancelPolicy element rather based on the 'RatePlanCode' and 'RoomTypeCode'.</p>
  
  <p>How could I appproach this problem. Thanks</p>