Since Craur is able to parse XML/HTML easily (by using DOMDocument, BUT not XPath under the hood), you might want to know from what diversity of headaches it safes you.
DOMDocument::loadXML/loadHTML and UTF-8: It does not like non-utf8 strings.
You have to work around this, by using iconv/mbstring:
<?php
$xml_string = iconv($encoding, 'utf-8', $xml_string);
$node = new DOMDocument('1.0', 'utf-8');
$is_loaded = $node->loadXML($xml_string, LIBXML_NOCDATA | LIBXML_NOWARNING | LIBXML_NOERROR);
if (!$is_loaded)
{
throw new Exception('Invalid xml: ' . $xml_string);
}