The paper addresses a problem of combining XML querying with ontology reasoning. We present an extension of a rule-based XML query and transformation language Xcerpt. The extension allows to interface an ontology reasoner from Xcerpt programs. In this way querying can employ the ontology information, for instance to filter out semantically irrelevant answers. The approach employs an existing Xcerpt engine and ontology reasoner; no modifications are required. We present the semantics of extended Xcerpt and an implementation algorithm. Communication between Xcerpt programs and ontology reasoner is based on DIG interface.