SimpleXML seems OK, but one thing that’s annoying is whenever assigning/storing a value you have to typecast it – this really is a tad annoying. DOM is OK but I really like the flexibility of XPath, sometimes DOM can be a tad too much writing-wise.
I really like the selector implementation in jQuery, and the flexibility. I came across http://jquery.hohli.com/ while googling but just wanted to see if anyone had recommendations before I try it out.
I use
SimpleXmlElementfor reading andDOMDocumentfor creating XML. You can also look at the XMLReader as in PHP 5.1. This is a fast way to “walktrough” an XML document. PHP also provides event-based XML parsing (SAX).If you have a good combination of read/write actions you maybe should extend the
SimpleXmlElementorDOMDocumentclasses or write a few helper functions which do all that casting work for you.