DOMDocument and XPath in a Drupal Module to Alter Links
I found this article by Artem Russakovskii very useful in working out the bugs for this module. More to come on this article. In the mean time check out Artem’s SmartDOMDocument – A Smarter PHP DOMDocument Class