based on xpath i want to select a part of xml and selected part i want to use as another xml source.
e.g:
<root>
<a type="t1">
<property name="data" value="val1"/>
</a>
<a type="t2">
<property name="data" value="val2"/>
</a>
<a type="t1">
<property name="data" value="val2"/>
</a>
</root>
xpath : /root/a[@type="t1"]/
and selected xml would be
<root>
<a type="t1">
<property name="data" value="val1"/>
</a>
<a type="t1">
<property name="data" value="val2"/>
</a>
</root>
same i want to use as another xml source in java. Please help me out.
NodeList, you could use theNodeListto build a secondDocument