I'll keep using your example but I mean it to be general and apply to similar sentences. In this specific case I agree with the commenter that "Then the extracted content is refined by adding or removing the node content" is best.
Then the extracted content is refined by adding or removing the node content to or from it.
This is fine. It's a bit clunky, but everyone will understand it, and as far as I know, it doesn't break any 'rules'. There are lots of other possibilities, but none of them sound completely smooth - there isn't a really natural way of phrasing this in English that I know of.
Then the extracted content is refined by adding or removing the node content from it.
Everyone will understand this as well, but I think it technically has a different meaning because it implies that node content can be "added from the extracted content", rather than added to it. But the way it's phrased, nobody would interpret it that way - I think in an informal context this would be fine, and actually is what you're probably most likely to hear in normal speech.
Then the extracted content is refined by adding/removing the node content to/from it.
I think this is just as clear as the first option, but less clunky. It's a bit less formal, but I'd still use it in academic writing, for instance.
Then the extracted content is refined by adding to it or removing from it the node content.
This is the least technically ambiguous but is a bit convoluted and horrid to read, so I think it'd be correct but I don't recommend it.