hello
I have a xml like this:

    <book>
            <Publication> myPublication0</Publication>
            <Publication> myPublication<bookName> my book</bookName></Publication>
            <Publication> myPublication1</Publication>
            <Publication> myPublication2<bookName> my book2</bookName>asd</Publication>
    </book>

and i want to read through java program and want output like

myPublication0
myPublication<bookName> my book</bookName>
myPublication1
myPublication2<bookName> my book2</bookName>asd

please tell how to get given output

read the input
process the input to output
look at the output.

if you need to work with xml using Java, JDom is a stable and very well documented library that can help you there.

is JDOM is already present in JDK???

nope. all you need can be found at the link I gave you earlier.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.