I have seen the same question being answered for vb and c#, but i need a Java best solution for appending nodes to an xml. Will xpath help?
I have
<A>
<B>
<c>1<c/>
<d>2<d/>
<e>3<e/>
</B>
<B>
<c>1<c/>
<d>2<d/>
<e>3<e/>
</B>
</A>
Need to append another
<B>
<c>11<c/>
<d>21<d/>
<e>31<e/>
</B>
XPath will help you to find nodes, but not really append them. I don’t think you’d find it particularly useful here.
Which XML API are you using? If it’s the W3C DOM (urgh) then you’d do something like: