Is it possible to use WFS.writeTransaction on the server side of a node application

I have a node application that traces a route on a road network and is returned in a JSON format.
I have created on OpenLayers feature from the JSON object and I want to save this feature into an OpenLayers v9 layer using WFS-T.
This processing is all occurring on the server side. There is no map interface.
When I call the WFS.writeTransaction() function I get TypeError: Cannot read properties of undefined (reading ‘createElementNS’)

I have done this successfully previously, but It has always been on the client side and with a map interface.

The code below is from the ol/xml.js file and seems to indicate there should be a document available

export function createElementNS(namespaceURI, qualifiedName) {
   return getDocument().createElementNS(namespaceURI, qualifiedName);
}

My question is is it possible to create a document on the server side so this writeTransaction method will succeed?