--- title: "Example: Retrieving Product Model Information as XML | Microsoft Docs" ms.custom: "" ms.date: "03/01/2017" ms.prod: sql ms.prod_service: "database-engine" ms.reviewer: "" ms.technology: xml ms.topic: conceptual helpviewer_keywords: - "RAW mode, retrieving XML information example" ms.assetid: 3828b4ca-3ab2-444f-9c58-8be6e7f064a6 author: MightyPen ms.author: genemi --- # Example: Retrieving Product Model Information as XML [!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)] The following query returns product model information. `RAW` mode is specified in the `FOR XML` clause. ## Example ``` USE AdventureWorks2012; GO SELECT ProductModelID, Name FROM Production.ProductModel WHERE ProductModelID=122 or ProductModelID=119 FOR XML RAW; GO ``` This is the partial result: `` `` You can retrieve element-centric XML by specifying the `ELEMENTS` directive. ``` USE AdventureWorks2012; GO SELECT ProductModelID, Name FROM Production.ProductModel WHERE ProductModelID=122 or ProductModelID=119 FOR XML RAW, ELEMENTS; GO ``` This is the result: ``` 122 All-Purpose Bike Stand 119 Bike Wash ``` You can optionally specify the `TYPE` directive to retrieve the results as **xml** type. The `TYPE` directive does not change the content of the results. Only the data type of the results is affected. ``` USE AdventureWorks2012; GO SELECT ProductModelID, Name FROM Production.ProductModel WHERE ProductModelID=122 or ProductModelID=119 FOR XML RAW, TYPE ; GO ``` ## See Also [Use RAW Mode with FOR XML](../../relational-databases/xml/use-raw-mode-with-for-xml.md)