I'm working on an API whereby a specific call would replace a subtree of an XML document—rooted at some element—with another subtree.
The two options I'm considering for a response to this call are:
- Return the DOM
- Return the modified subtree
In the interests of developing a standardized, stable API, I'd like to get this right. Is there a best way to handle this type of scenario? What are the benefits and drawbacks of doing it one way over the other? Would it make sense to offer both these options to API consumers?