Hello,
Headings are paragraphs with an extra tag:
<w:outlineLvl val="{heading level}">
You can query a heading as a paragraph content, this is by its content, position... If the heading level is not set as an external style, you can query by the outlineLvl tag using the attributes option or a custom query with DOCXPath.
Regards.