def _remove_child_node(node, context, xast, if_empty=False):
xpath = serialize(xast)<EOL>child = _find_xml_node(xpath, node, context)<EOL>if child is not None:<EOL><INDENT>if if_empty is True andnot _empty_except_predicates(xast, child, context):<EOL><INDENT>return False<EOL><DEDENT>node.remove(child)<EOL>return True<EOL><DEDENT>
Remove a child node based on the specified xpath.

    :param node: lxml element relative to which the xpath will be
        interpreted
    :param context: any context required for the xpath (e.g.,
        namespace definitions)
    :param xast: parsed xpath (xpath abstract syntax tree) from
        :mod:`eulxml.xpath`
    :param if_empty: optional boolean; only remove a node if it is
        empty (no attributes and no child nodes); defaults to False

    :returns: True if a node was deleted