<?php
//Responses from Intuit
  /*$str = '<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE QBMSXML PUBLIC "-//INTUIT//DTD QBMSXML QBMS 4.1//EN" "http://merchantaccount.ptc.quickbooks.com/dtds/qbmsxml41.dtd">
<QBMSXML>
 <SignonMsgsRs>
  <SignonDesktopRs statusCode="0" statusSeverity="INFO">
   <ServerDateTime>2010-10-01T07:33:44</ServerDateTime>
   <SessionTicket>V1-247-f6pnXzO2I5kMsFN71StX1Q:180844696</SessionTicket>
  </SignonDesktopRs>
 </SignonMsgsRs>

 <QBMSXMLMsgsRs>
  <CustomerCreditCardChargeRs statusCode="0" statusMessage="Status OK" statusSeverity="INFO">
   <CreditCardTransID>ZZ7030748703</CreditCardTransID>
   <AuthorizationCode>889515</AuthorizationCode>
   <AVSStreet>Pass</AVSStreet>
   <AVSZip>Pass</AVSZip>
   <CardSecurityCodeMatch>NotAvailable</CardSecurityCodeMatch>

   <MerchantAccountNumber>5502793081227973</MerchantAccountNumber>
   <ReconBatchID>420101001 1Q00335502793081227973AUTO04</ReconBatchID>
   <PaymentGroupingCode>5</PaymentGroupingCode>
   <PaymentStatus>Completed</PaymentStatus>
   <TxnAuthorizationTime>2010-10-01T07:33:44</TxnAuthorizationTime>
   <TxnAuthorizationStamp>1285918424</TxnAuthorizationStamp>

   <ClientTransID>q006d2dd</ClientTransID>
  </CustomerCreditCardChargeRs>
 </QBMSXMLMsgsRs>
</QBMSXML>';*/

    $str = '<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE QBMSXML PUBLIC "-//INTUIT//DTD QBMSXML QBMS 4.1//EN" "http://merchantaccount.ptc.quickbooks.com/dtds/qbmsxml41.dtd">
<QBMSXML>
 <SignonMsgsRs>
  <SignonDesktopRs statusCode="0" statusSeverity="INFO">

   <ServerDateTime>2010-10-01T09:25:32</ServerDateTime>
   <SessionTicket>V1-247-PL3Qdth0yT36sUbXZAbcGQ:180844696</SessionTicket>
  </SignonDesktopRs>
 </SignonMsgsRs>
 <QBMSXMLMsgsRs>
  <CustomerCreditCardTxnVoidOrRefundRs statusCode="0" statusMessage="Status OK" statusSeverity="INFO">
   <CreditCardTransID>ZZ5513425551</CreditCardTransID>

   <ClientTransID>q006d2f6</ClientTransID>
   <VoidOrRefundTxnType>Refund</VoidOrRefundTxnType>
   <MerchantAccountNumber>5502793081227973</MerchantAccountNumber>
   <ReconBatchID>420101001 1Q02255502793081227973AUTO04</ReconBatchID>
   <PaymentGroupingCode>5</PaymentGroupingCode>
   <PaymentStatus>Completed</PaymentStatus>

   <TxnAuthorizationTime>2010-10-01T09:25:32</TxnAuthorizationTime>
   <TxnAuthorizationStamp>1285925132</TxnAuthorizationStamp>
  </CustomerCreditCardTxnVoidOrRefundRs>
 </QBMSXMLMsgsRs>
</QBMSXML>';

/*    $str = '<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE QBMSXML PUBLIC "-//INTUIT//DTD QBMSXML QBMS 4.1//EN" "http://merchantaccount.ptc.quickbooks.com/dtds/qbmsxml41.dtd">
<QBMSXML>
 <SignonMsgsRs>
  <SignonDesktopRs statusCode="0" statusSeverity="INFO">

   <ServerDateTime>2010-10-01T09:54:28</ServerDateTime>
   <SessionTicket>V1-247-H1QXbRfk$XfhBIdjKjL45Q:180844696</SessionTicket>
  </SignonDesktopRs>
 </SignonMsgsRs>
 <QBMSXMLMsgsRs>
  <CustomerCreditCardTxnVoidOrRefundRs statusCode="10305" statusMessage="An error occurred during data validation. Specified credit amount exceeds amount available on original transaction. " statusSeverity="ERROR"/>
 </QBMSXMLMsgsRs>
</QBMSXML>';*/


    $xmlObj = simplexml_load_string($str);
    $xmlObj = $xmlObj;

    //preg_match_all ("/<(.*?)>(.*?)\</", $str, $xmlObj, PREG_SET_ORDER);
    echo '<pre>';
    print_r ($xmlObj);

    /*$attr = $xmlObj->QBMSXMLMsgsRs->CustomerCreditCardTxnVoidOrRefundRs;
    foreach($attr->attributes() as $index => $value)
    {
        echo $index .'=>'. $value .'<br>';
    }*/

    echo '</pre>';
?>