My guess is that after the remove you're again writing something to OBX(2). Even before you did the remove OBX(2) is marked with a "*", which means that it got changed. And after the remove field-1 still contains the value 2 (this is probably what you're setting later).
What Robert is talking about is the SOAP wizard in Caché, what you're looking for is the import of XML definitions as Ensemble virtual document structures. These definitions are not stored as classes but just exist in a global (for XML it's EnsEDI.XML.Schema). That's also true for HL7. In Studio HL7 is listed in the category "others", which means that it is not a class. I can see other document structures there, like .AST and .X12, but XML doesn't appear. I don't know whether there is a reason for that, maybe the only reason is that nobody requested it up to now because they're using the Management Portal interface.
Hi Francisco,
What you need is:
set prod=##class(Ens.Config.Production).%OpenId(productionName)
do prod.RemoveItem(objItem)
do prod. %Save()