The extensible Markup Language (XML) has known since its beginnings an undeniable success. Defined since its origins as a meta-language facilitating the development of specialized tags Languages, nowadays, many documents benefit from the XML frame. But even if this language is strongly used in the web as a way of data exchange between applications, it still lack the capacity of defining the web resources and the system that uses them, and also the capacity of expressing the knowledge provided by XML documents. It's these lacks that proposes the Web Ontology Language (OWL) proposes to fill. In fact, OWL is a language for ontologies representation in the context of Semantic Web (SW). It's in this context that we're obliged to come up with a solution that allows migration to the SW in order to follow the WEB evolution. Among the suggested solutions, our approach models and implements a set of rules that allow transforming an XML Schema Definition (XSD) to Ontology. This mapping will transform not only the nodes of an XML file but also the relationships between these nodes in order to maintain the same structure.