---
title: "XML document, XSLT and WSDL"
subject: "Web Technology"
chapter: 7
key: "semester_7/web_technology:xml-xslt-wsdl"
source: https://www.bctengineer.com/q/semester_7/web_technology/xml-xslt-wsdl
site: BCT Engineering
---

# XML document, XSLT and WSDL

Web Technology · Chapter 7: Information representation and sharing – XML

- Asked in: 2074 Chaitra, 3+4 marks
- Video: [What is XML | XML Beginner Tutorial | Learn XML with Demo in 10 min](https://www.youtube.com/watch?v=1JblVElt5K0) — Automation Step by Step
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/web_technology/xml-xslt-wsdl
- Whole chapter: https://www.bctengineer.com/md/semester_7/web_technology/chapter-7

## Question

Explain about XML document? Explain XSLT and WSDL.

## Short answer

An XML document is a text file with a hierarchical tree of user-defined tags, consisting of prolog, one root element, child elements and attributes, and must be well-formed. XSLT transforms XML into other formats like HTML using template rules and XPath. WSDL is an XML language that describes a web service's operations, messages, and endpoint address for clients.

## Answer

#### XML document
An **XML document** is a text file that stores data in a hierarchical tree of elements with user-defined tags. It consists of a prolog (`<?xml version="1.0"?>`, optional DOCTYPE), one **root element**, child elements, attributes, text, comments and so on. It is **well-formed** if it follows XML syntax rules, and **valid** if it also conforms to a DTD or XML Schema.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<students>
  <student id="1"><name>Anil</name><marks>85</marks></student>
</students>
```

#### XSLT
**XSLT (eXtensible Stylesheet Language Transformations)** is an XML-based language that transforms an XML document into another format (HTML, plain text, or another XML). An XSLT processor applies the rules (templates) of a stylesheet to the source tree and produces a result tree. It uses **XPath** to select nodes.
```xml
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html><body><table>
      <xsl:for-each select="students/student">
        <tr><td><xsl:value-of select="name"/></td>
            <td><xsl:value-of select="marks"/></td></tr>
      </xsl:for-each>
    </table></body></html>
  </xsl:template>
</xsl:stylesheet>
```
```text
XML + XSLT stylesheet --> XSLT processor --> HTML / XML / text
```

#### WSDL
**WSDL (Web Services Description Language)** is an XML-based language that describes a web service: what it does, where it is, and how to call it. It lets a client program discover the operations and message formats without human help. Main elements:
- `types` – data types (XML Schema)
- `message` – input/output data
- `portType` – abstract operations
- `binding` – protocol (SOAP/HTTP) and data format
- `service` / `port` – the endpoint address (URL)

A WSDL file is published (for example in a UDDI registry) and used with SOAP.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which statement about an XML document is correct?
   A. It has one root element and is a tree of elements
   B. It may have many roots
   C. It has no hierarchy
   D. It must have a DTD
   Answer: A. An XML document is a hierarchical tree with a single root. (Key point: Root element)

2. What does XSLT do?
   A. Stores web service endpoints
   B. Transforms an XML document into HTML, text or other XML
   C. Validates the DTD
   D. Sends emails
   Answer: B. XSLT transforms using templates and XPath. (Key point: XSLT)

3. Which language does XSLT use to select nodes?
   A. SQL
   B. DOM events
   C. CSS
   D. XPath
   Answer: D. XSLT uses XPath to select nodes. (Key point: XPath)

4. What does WSDL describe?
   A. A stylesheet
   B. A database schema
   C. A DOM tree
   D. A web service: what it does, where it is and how to call it
   Answer: D. WSDL is an XML language describing web services. (Key point: WSDL)

## Related in Web Technology

- [XML and DTD; Teacher XML document](https://www.bctengineer.com/question.md?key=semester_7%2Fweb_technology%3Axml-teacher-dtd) — Web Technology, chapter 7, asked 2×
- [XML Student document and its DTD](https://www.bctengineer.com/question.md?key=semester_7%2Fweb_technology%3Axml-student-dtd) — Web Technology, chapter 7, asked 2×
- [Well formed XML and DTD example](https://www.bctengineer.com/question.md?key=semester_7%2Fweb_technology%3Awell-formed-xml-dtd-example) — Web Technology, chapter 7
