private void FixIllegalIds(HtmlDom pageDom)
{
// Xpath results are things that have an id attribute, so MUST be XmlElements (though the signature
// of SafeSelectNodes allows other XmlNode types).
foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@id]"))
{
var id = elt.Attributes["id"].Value;
var first = id[0];
if (first >= '0' && first <= '9')
elt.SetAttribute("id", "i" + id);
}
}