Validation: Relax-NG


<element name="p"
   xmlns="http://relaxng.org/ns/structure/1.0">
  <zeroOrMore>
    <choice>
      <text/>
      <element name="a">
        <attribute name="href"/>
        <text/>
      </element>
    </choice>
  </zeroOrMore>
</element>

See example 4, XML, RNG