Interpreting legacy XML documents is a great challenge for realizing the vision of the Semantic Web (SW). This paper presents an algorithm to transform XML data into RDF- foundation language of the SW automatically. Our approach maps element definitions stored in XML Schema to RDF Schema ontology, where the ontology is used to describe the meaning and relationships between XML elements. The RDF results containing XML data at the semantic level while retaining their nesting structure make huge XML data source on the current web be available for the SW.