Well, I've had it with DOMDocument. Added custom XML formatting function for pretty printing.