@dpobel

Yes and no... This is simpler, provided that:
* the XML contains a full DOCTYPE definition including which attributes are **ID**s and activating: `$doc->validateOnParse = true` before loading or...
* the XML contains a reference to a schema file and the xml being validated with: `$doc->schemaValidate()` or...
* `DOMElement::setIdAttribute()` is used on the correct DOMElement to indicate what attribute is the **ID**.

It generally work well on HTML that contains a known DOCTYPE that already declares what attributes are **ID**s.