I have the following xml

```
<?xml version="1.0" encoding="utf-8"?>
<movies>
 <movie>
  <title>Star Wars</title>
  <genre>sci-fi</genre>
  <year>1977</year>
  <cast>
   <character cid="001">
    <role>Hero</role>
    <name>
     <first>Mark </first>
     <last>Hamill</last>
    </name>
   </character>
    <character cid="002">
               <role> Ass </role>
    <name> 
    <first> Jack</first>
    <last> Apple</last>
    </name>
   </character>
  </cast>
  <director>
    <name> 
      <first> Mark </first>
      <last> Hamill</last>
    </name>
    </director>
  <producer />
  <studio>Disney</studio>
 </movie>

 <movie>
  <title>Star Wars 2</title>
  <genre>sci-fi</genre>
  <year>20112</year>
  <cast>
   <character cid="002">
    <role>Hero</role>
    <name>
     <first>Mark</first>
     <last>Joseph</last>
    </name>
   </character>
  </cast>
  <director />
  <producer />
  <studio>Disney</studio>
 </movie>
 <people peoid="001">
  <name>
   <first>Mark </first>
   <last>Wei</last>
  </name>
  <name>
   <first> John</first>
   <last> Doe</last>
  </name>
 </people>
</movies>

```

I am trying to come up with an Xpath query that would give the title of all the movies where the director is also an actor. For example below, Mark Hamill appears in the cast and is also the director. I know the xpath expression to get the director name: /movies/movie/director[name]. And the xpath expression to get the name from the cast /movies/movie/cast/character[name]. Is there a way to combine the both to get the required xpath?