It is generally accepted that the fracture strain is dependent on geometry/constraints in metals. However, the current available implementation of XFEM assumes a fixed fracture strain criterion independent of the constraints. The objective of this paper is to develop and implement a variable fracture strain criterion in XFEM that is capable of predicting a wide range of fracture conditions in X65 pipeline steels with various crack tip constraints. Various small-scale tests with different out of plane constraints obtained from the literature were simulated using the XFEM in ABAQUS software. These tests included smooth bar, notched bar, single edge notch tension (SENT), and single edge notch bending (SENB) tests. For each test, the value of the maximum principal strain (Maxpe) as a fracture initiation criterion in the cohesive zone model (CZM) in XFEM framework was varied while keeping the fracture energy constant until the model was able to accurately replicate the reported experimental results. For each test, the crack tip constraints were characterized and the stress triaxialities and Lode angle parameters at the onset of fracture initiation were calculated from the models. The results allowed expressing the fracture strain as an explicit function of stress triaxiality which was then implemented in ABAQUS XFEM using UDMGINI subroutine. For the sake of comparison, the tests were simulated in finite element method (FEM) using a similar damage initiation model namely, the Johnson-Cook (J-C) model. A single model in XFEM was able to accurately replicate the experimental observations for all specimens and compared well to experiments in the way simulated by FEM damage model. However, it was observed that XFEM was more suitable to simulate specimens with pre-existing cracks such as in SENT and SENB tests since the crack grew through elements when mesh refinement was not required around the crack tips. Lastly, the simulated results were found to be less mesh sensitive in XFEM than in FEM damage models.