Using XSD to remove elements in a XML object?

please anyone if u know what i can use to do this, reply to this...

i have an XML file which contains, e.g. 10 elements, and a XSD file which expects only a subset of this XML file, e.g. 5 elements from this XML file. The document structure of this XML and the XSD file are the same.

i want to know if there is any method i can use to extract data from this XML file based on the XSD file?

many many thanks.. any ideas are welcomed..

[458 byte] By [JWKC-5ivea] at [2007-11-27 4:44:15]
# 1
no. XSD describes a document, it can not manipulate it.You could write a piece of software that reads in XML files and removes everything in them that doesn't conform to a specified XSD document, and such tools may even exist, but it's not standard behaviour.
jwentinga at 2007-7-12 9:56:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Even that isn't well-defined. If the schema says you can only have one <abc> element and the document has three, which two should be removed?
DrClapa at 2007-7-12 9:56:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
xslt actually does what i want to do, but is there any other way i can do such transformation?
JWKC-5ivea at 2007-7-12 9:56:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
got a solution... jaxb... java binding
JWKC-5ivea at 2007-7-12 9:56:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...