This paper presents and exercises a general structure for an object-oriented-enriched finite element code. The programming environment provides a robust tool for extended finite element (XFEM) computations and a modular and extensible system. The programme structure has been designed to meet all natural requirements for modularity, extensibility, and robustness. To facilitate mesh–geometry interactions with hundreds of enrichment items, a mesh generator and mesh database are included. The salient features of the programme are: flexibility in the integration schemes (subtriangles, subquadrilaterals, independent near-tip, and discontinuous quadrature rules); domain integral methods for homogeneous and bi-material interface cracks arbitrarily oriented with respect to the mesh; geometry is described and updated by level sets, vector level sets or a standard method; standard and enriched approximations are independent; enrichment detection schemes: topological, geometrical, narrow-band, etc.; multi-material problem with an arbitrary number of interfaces and slip-interfaces; non-linear material models such as J2 plasticity with linear, isotropic and kinematic hardening. To illustrate the possible applications of our paradigm, we present 2D linear elastic fracture mechanics for hundreds of cracks with local near-tip refinement, and crack propagation in two dimensions as well as complex 3D industrial problems. Copyright © 2007 John Wiley & Sons, Ltd.