-- ORDER BY inside the aggregate — not obvious in Doctrine DQLSELECTe.category,XMLAGG(e.xmlDataORDERBYe.createdAt)FROMApp\Entity\ArticleeGROUPBYe.category-- xml_is_well_formed uses the session xmloption (DOCUMENT or CONTENT mode)-- xml_is_well_formed_document always requires a single root element-- xml_is_well_formed_content accepts fragments and plain text nodesSELECTXML_IS_WELL_FORMED(e.xmlText)FROMApp\Entity\ArticleeSELECTXML_IS_WELL_FORMED_DOCUMENT(e.xmlText)FROMApp\Entity\ArticleeSELECTXML_IS_WELL_FORMED_CONTENT(e.xmlText)FROMApp\Entity\Articlee-- XPath text() node extraction and attribute predicatesSELECTXPATH('//item/title/text()',e.xmlData)FROMApp\Entity\ArticleeWHEREe.id=:idSELECTXPATH_EXISTS('//item[@active="true"]',e.xmlData)FROMApp\Entity\ArticleeWHEREe.id=:id-- XPath existence test (boolean) and XML processing instructionSELECTXMLEXISTS('//item',e.xmlData)FROMApp\Entity\ArticleeWHEREe.id=:idSELECTXMLPI('php','echo "hello";')FROMApp\Entity\ArticleeWHEREe.id=:id