def METHOD_NAME(self):
    env = self.state.document.settings.env
    hxfile = env.config.hxtool_srctree + '/' + self.arguments[0]
    # Tell sphinx of the dependency
    env.note_dependency(os.path.abspath(hxfile))
    state = HxState.CTEXT
    # We build up lines of rST in this ViewList, which we will
    # later put into a 'section' node.
    rstlist = ViewList()
    current_node = None
    node_list = []
    with open(hxfile) as f:
        lines = (l.rstrip() for l in f)
        for lnum, line in enumerate(lines, 1):
            directive = parse_directive(line)
            if directive == 'HXCOMM':
                pass
            elif directive == 'SRST':
                if state == HxState.RST:
                    serror(hxfile, lnum, 'expected ERST, found SRST')
                else:
                    state = HxState.RST
            elif directive == 'ERST':
                if state == HxState.CTEXT:
                    serror(hxfile, lnum, 'expected SRST, found ERST')
                else:
                    state = HxState.CTEXT
            elif directive == 'DEFHEADING' or directive == 'ARCHHEADING':
                if directive == 'DEFHEADING':
                    heading = parse_defheading(hxfile, lnum, line)
                else:
                    heading = parse_archheading(hxfile, lnum, line)
                if heading == "":
                    continue
                # Put the accumulated rST into the previous node,
                # and then start a fresh section with this heading.
                if len(rstlist) > 0:
                    if current_node is None:
                        # We had some rST fragments before the first
                        # DEFHEADING. We don't have a section to put
                        # these in, so rather than magicing up a section,
                        # make it a syntax error.
                        serror(hxfile, lnum,
                               'first DEFHEADING must precede all rST text')
                    self.do_parse(rstlist, current_node)
                    rstlist = ViewList()
                if current_node is not None:
                    node_list.append(current_node)
                section_id = 'hxtool-%d' % env.new_serialno('hxtool')
                current_node = nodes.section(ids=[section_id])
                current_node += nodes.title(heading, heading)
            else:
                # Not a directive: put in output if we are in rST fragment
                if state == HxState.RST:
                    # Sphinx counts its lines from 0
                    rstlist.append(line, hxfile, lnum - 1)
    if current_node is None:
        # We don't have multiple sections, so just parse the rst
        # fragments into a dummy node so we can return the children.
        current_node = nodes.section()
        self.do_parse(rstlist, current_node)
        return current_node.children
    else:
        # Put the remaining accumulated rST into the last section, and
        # return all the sections.
        if len(rstlist) > 0:
            self.do_parse(rstlist, current_node)
        node_list.append(current_node)
        return node_list