To create a new DOMQuery, use QueryPath::with() or qp() function.
If you are new to these documents, start at the QueryPath.php page.
There you will find a quick guide to the tools contained in this project.
A note on serialization: DOMQuery uses DOM classes internally, and those
do not serialize well at all. In addition, DOMQuery may contain many
extensions, and there is no guarantee that extensions can serialize. The
moral of the story: Don't serialize DOMQuery.