In theory, yes, anything you can do with XSL, you can do by programming in Java using the DOM tree produced by an XML parser. In theory, you don't need the parser, either; you could read the XML with a FileReader and pick through it yourself. Heck, you don't even need Java, do you: you could write the same program in 80x86 assembly language.

My point is that different tools operate at different levels, and have different strengths. Many simple querying and transformation tasks are clearer and easier to write in XSL.

Originally posted by Phani Sridhar: With parsers we can actually add or delete the nodes of an xml.

Well, no, this is incorrect. The purpose of a parser is to convert an XML document -- a text file, usually -- into some internal form. A DOM parser converts a document into a Document object, a SAX parser converts it into a series of SAX events, and so on. No adding or deleting of nodes will occur here.

You can certainly take the Document object which is the output of the parser and add or delete nodes, though.

And just for completeness: a serializer is used to convert some internal form into an XML document.