title: PHP DOM vs SimpleXML for Atom GData feed parsing
body: <p>I'm building a library to access the Google Analytics Data Export API. All the data the library accesses is in Atom format and utilises numerous different namespaces throughout. My experiments with the API have used SimpleXML for parsing so far, especially as all I have been doing is accessing the data held within the feed.</p>
  
  <p>Now I'm coming to write a library I am wondering whether forging ahead with SimpleXML will be adequate or whether the enhanced functionality of the DOM module in PHP would be of benefit in the future. I haven't written much code for this part of the library yet so the choice is still open.</p>
  
  <p>I have read that the PHP DOM module can be a better choice if you need to build an XML DOM on the fly or modify an existing one, but I'm not entirely sure I would need that functionality anyway due to the nature of the API (no pushing data to the server, for instance). SimpleXML is certainly easier to use and I have seen people saying that for read-only situations it is all you need.</p>
  
  <p>Essentially the question is, what would you use? Compatibility will not be an issue as the server configuration will match the application's requirements. Is it worth building the library with PHP DOM in mind or should I stick with SimpleXML for now?</p>
  
  <p><strong>Update:</strong> Here are two examples of the kind of feeds I will be dealing with:</p>
  
  <ol>
  <li><a href="http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/accountFeedResponse.xml" rel="nofollow noreferrer">Account feed</a></li>
  <li><a href="http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/dataFeedResponse.xml" rel="nofollow noreferrer">Data feed</a></li>
  </ol>