There are 2 distinct problems:  the Java input problem (mine) and the XML input problem (Don).  Solving the XML input problem doesn’t solve the Java input problem.<div dir="auto"><br></div><div dir="auto">My requirements:<div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple paths to a DEF x3dnode in a directed acyclic graph.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple DEF x3dnodes with same value and combine attributes, and replace second or further DEF x3dnodes with a USE xmlnode on output.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, only have an  DEF attribute value for the first of xmlnodes with same DEF/USE value.  The remaining x3dnodes with the same DEF/USE will have a USE value, and potentially a containerField value different from DEF and USE x3dnodes with the same DEF/USE value.   THE USE nodes will have a name attribute value where required.</div><div dir="auto"><br></div><div dir="auto">It appears that to meet these requirements a second pass on output will be required.   I believe the only way to avoid this is to only have one x3dnode for each DEF/USE value.  We could make that a requirement of X3DJSAIL users, but I haven’t seen any traction on that.</div><div dir="auto"><br></div><div dir="auto">It might be required that a second pass on input if USE is before DEF, especially if USE is before DEF.   We can’t avoid USE before DEF on output without a second pass.  Field order canonicalization and author intent are non-starters.</div><div dir="auto"><br></div><div dir="auto">So it appears like we need 3 passes, an input pass, a common DEF/USE x3dnode discovery pass, and an output pass.  I would prefer to put the discovery pass after the scene is built, because who knows what a Java developer is going to put together.</div><div dir="auto"><span style="font-family:-apple-system,sans-serif"><br></span></div><div dir="auto"><span style="font-family:-apple-system,sans-serif">Thanks for reading,</span><br></div><div dir="auto"><span style="font-family:-apple-system,sans-serif"><br></span></div><div dir="auto"><span style="font-family:-apple-system,sans-serif">John </span></div></div>