XML and RDF are the W3C standard for representing and exchanging data and metadata about Web resources. Meanwhile, XQuery and SPARQL have been acknowledged as the standard query languages for querying the XML and RDF data models. In particular, they represent the counterpart of the SQL language in the world of relational databases. With the continued increase of XML and RDF usage on the Web and in corporate environments, efficient and scalable management of XML and RDF data represent fundamental challenges at the core of the vision of Web data management. Therefore, several techniques and systems have been proposed to tackle this problem. In this tutorial, we provide a comprehensive background on the fundamentals of querying, exchanging, and integrating XML and RDF data. In addition, we provide a comprehensive overview of the main representatives of XML and RDF data management techniques and systemsi, covering an in-depth analysis of their different technical design decisions.