The 65535 line number limit is no longer a problem when you use libxml 2.9 or higher, but you have to explicitly enable support for big line numbers:<?phpdefine('XML_PARSE_BIG_LINES', 4194304);$dom = new DOMDocument;$dom->loadXML($xml, XML_PARSE_BIG_LINES);?>