Question: I've a xml like follows,

```
<doc>
  <chap>&lt;The root&gt;
     &lt;element that&gt;
     &lt;declares&gt;
     &lt;the document to be an XSL style sheet&gt;</chap>
</doc>

```

I need to write xsl to add separate nodes named `<p>` to text where exist between `&lt;` and `&gt;`within `<chap>`.

So the output should be,

```
<doc>
  <p>&lt;The root&gt;</p>
  <p>&lt;element that&gt;</p>
  <p>&lt;declares&gt;</p>
  <p>&lt;the document to be an XSL style sheet&gt;</p>
</doc>

```

I can write a template to the text inside `<chap>` node like, `<xsl:template match="chap/text()"` but I cannot think of a way to add new `<p>` by analyzing the text() node within `<chap>`

Any suggestions how can I do this?

Answer: 
**(Note: This answer is now outdated.)**

There's a neat project that shows the flags alongside their warning messages:

<https://github.com/NSHipster/fuckingclangwarnings.com>

While these are not comprehensive explanations in all cases, it is very helpful, especially when you want to switch off specific warnings.

The project hasn't been updated in a while and is probably missing a few new warnings. You could also dive into Clang's source code. I haven't worked with it in a while, but I can tell you where to start:

1. Clone the [Clang repository](http://llvm.org/docs/GettingStarted.html#checkout)
2. Browse to [`/include/clang/Basic/Diagnostic.td`](https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/Diagnostic.td). This file includes a couple of other `.td` files which contain the various warnings, though I'm not sure if all of them are publicly available, and I think their external names are prefixed, depending on their category. I suggest searching for a known warning (or its description) to solve the puzzle.
3. Another interesting file is [`/include/clang/Driver/Options.td`](https://github.com/llvm-mirror/clang/blob/master/include/clang/Driver/Options.td), which includes the texts you get using the `help` command, if I recall correctly.
I realize this is an old question, but a complete list of warnings, along with the text printed for each one, can be found in the [Clang Documentation](https://clang.llvm.org/docs/DiagnosticsReference.html).