In order to demonstrate this I would prefer comparison approach so that you will get quick idea of key concepts of XML operations.
This demonstration is for those who are new to XML from SQL Server. For this demonstration lets create two table


 

USE TEMPDB
GO
CREATE TABLE Employee(
      EmployeeID [int] IDENTITY(1,1) NOT NULL, 
      EmployeeName [nvarchar](126) NULL)
GO
CREATE TABLE EmployeeAddress(
      EmployeeAddressID [int] IDENTITY(1,1) NOT NULL,
      EmployeeID [int] NOT NULL,
      City [nvarchar](126) NULL,
      Country [nvarchar](126) NULL)
GO
 INSERT INTO Employee (EmployeeName) VALUES (Jay)
 GO
 INSERT INTO Employee (EmployeeName) VALUES (Viru) 
 GO 
 INSERT INTO EmployeeAddress (EmployeeID,City, Country) VALUES (1,Mumbai,India)
GO
 INSERT INTO EmployeeAddress (EmployeeID,City, Country) VALUES (2,NewYork,USA)
GO
Employee
EmployeeID
EmployeeName
1
Jay
2
Viru
EmployeeAddress
EmployeeAddressID
EmployeeID
City
Country
1
1
Mumbai
India
2
2
NewYork
USA
 
Using RAW
 
Select EmployeeID, EmployeeName from Employee For XML raw
 
<row EmployeeID="1" EmployeeName="Jay" />
<row EmployeeID="2" EmployeeName="Viru" />
 
Using AUTO
 
Select EmployeeID, EmployeeName from Employee For XML auto
 
<Employee EmployeeID="1" EmployeeName="Jay" />
<Employee EmployeeID="2" EmployeeName="Viru" />
 
Using PATH
Select EmployeeID, EmployeeName from Employee For XML path(EmployeePath)
<EmployeePath>
  <EmployeeID>1EmployeeID>
  <EmployeeName>JayEmployeeName>
EmployeePath>
<EmployeePath>
  <EmployeeID>2EmployeeID>
  <EmployeeName>ViruEmployeeName>
EmployeePath
 
Using EXPLICIT
 
Select 1 as tag,
Null as parent,
EmployeeID as "Employee!1!EmployeeID",
EmployeeName as "Employee!1!EmployeeName"  
from Employee For XML explicit
 
<Employee EmployeeID="1" EmployeeName="Jay" />
<Employee EmployeeID="2" EmployeeName="Viru" />
 
In next article we will see other operator in SQL server and there operations with XML