How can I use line numbering for an XDMNode?

 

I have something like the following:

 

 

Saxon.Api.XdmNode saxonNode;

Saxon.Api.XdmDestination results = new Saxon.Api.XdmDestination();

saxonNode = _SaxonDoc.Build(XMLFile);

 

transformer.Run(results);

transformer2.InitialContextNode = results.XdmNode;

results.Reset();

transformer2.Run(results);

 

 

 

Except I need line numbering on for the second transformation.  Do I have to pass my results.XDMNode back to the DocumentBuilder and if so what’s the best way to do that?

 

A little context: I’m using the saxon line number function to generate “unique” ids for elements.  I need unique integers (unique only for that element type for that file) and figured that was the best way to do it.

 

Steve